/Users/martina/NetbeansProjects/Ercolino Workolino/src/dossier/pkgfor/ercolino/mainDossierGUI.java
   1 /*
   2  * To change this license header, choose License Headers in Project Properties.
   3  * To change this template file, choose Tools | Templates
   4  * and open the template in the editor.
   5  */
   6 
   7 /* 
   8  Extensibility Ideas
   9  Monday May 12
  10  Start with: save 
  11  open
  12  help button -pop-up = help menu
  13  hover thing
  14  LONG TERM TO DO:
  15  fields demonstate how to fill them in and clear when clicked
  16  example shown
  17  example described right under a text field
  18  combo boxesand other GUI elements themselves
  19  seperate wedsite to go
  20  seperate Help window (but how to close and not close the first window)
  21  */
  22 package dossier.pkgfor.ercolino;
  23 
  24 import java.io.BufferedReader;
  25 import java.io.BufferedWriter;
  26 import java.io.FileNotFoundException;
  27 import java.io.FileReader;
  28 import java.io.FileWriter;
  29 import java.io.IOException;
  30 import java.util.ArrayList;
  31 import java.util.StringTokenizer;
  32 import java.util.logging.Level;
  33 import java.util.logging.Logger;
  34 import javax.swing.JFileChooser;
  35 import javax.swing.JOptionPane;
  36 
  37 /**
  38  *
  39  * @author martina
  40  */
  41 public class mainDossierGUI extends javax.swing.JFrame {
  42 
  43     /**
  44      * Creates new form mainDossierGUI
  45      *
  46      */
  47     ArrayList<VagetableOrFruit> dossierForErcolinoList = new ArrayList();
  48     //<<<<-----
  49     ArrayList<VagetableOrFruit> dossierForErcolinoListOther = new ArrayList();
  50 
  51     public mainDossierGUI() {
  52         initComponents();
  53         myInit();
  54         myOtherInit();
  55 
  56     }
  57 
  58     private void myInit() {
  59         //Here I created button groups of both Radio Buttons of "frost" and "isIndoor"
  60         //I set them equal to true, so the user can click only one at a time.
  61         buttonGroup1.add(isFrostRB);
  62         buttonGroup1.add(isNotFrostRB);
  63         isFrostRB.setSelected(true);
  64         buttonGroup5.add(springIsIndoorRB);
  65         buttonGroup5.add(springIsNotIndoorRB);
  66         springIsIndoorRB.setSelected(true);
  67     }
  68     //This is again a button group but of the "Other" tab
  69     private void myOtherInit() {
  70         buttonGroup6.add(otherIsIndoorRB);
  71         buttonGroup6.add(otherIsNotIndoorRB);
  72         otherIsIndoorRB.setSelected(true);
  73     }
  74 
  75     /**
  76      * This method is called from within the constructor to initialize the form.
  77      * WARNING: Do NOT modify this code. The content of this method is always
  78      * regenerated by the Form Editor.
  79      */
  
1012 
1013     private void exitMenuItemActionPerformed(java.awt.event.ActionEvent evt) {                                             
1014         System.exit(0);
1015     }                                            
1016     //continue here...
1017     private void saveSpringMIMouseReleased(java.awt.event.MouseEvent evt) {                                           
1018         //When the user releases the mouse from clicking "save spring"
1019         //The info inputed will save (on the table) and show save dialog. 
1020         System.out.println("Im inside save spring");
1021         JFileChooser jfc = new JFileChooser();
1022         jfc.showSaveDialog(this);
1023 // jfc.showOpenDialog(this);
1024         try {
1025             // TODO add your handling code here:
1026             FileWriter fw = new FileWriter(jfc.getSelectedFile());
1027             // FileWriter fw = new FileWriter("/Library/Application Support/ErcoFarm/practice.txt");
1028             BufferedWriter bw = new BufferedWriter(fw);
1029             //This code will allow the information inputed by the user to display
1030             //on the "spring" table.
1031             for (int i = 0; i < dossierForErcolinoList.size(); i++) {
1032 
1033                 bw.write(dossierForErcolinoList.get(i).getVegetable() + ":");
1034                 bw.write(dossierForErcolinoList.get(i).getFruit() + ":");
1035                 bw.write(dossierForErcolinoList.get(i).getFrost() + ":");
1036                 bw.write(dossierForErcolinoList.get(i).getDateOfPlanting() + ":");
1037                 bw.write(dossierForErcolinoList.get(i).getDateOfFrost() + ":");
1038                 bw.write(dossierForErcolinoList.get(i).getAmountOfYield() + ":");
1039                 bw.write(dossierForErcolinoList.get(i).getIsIndoor() + ":");
1040                 bw.write(dossierForErcolinoList.get(i).getcomment() + ":");
1041                 bw.write(dossierForErcolinoList.get(i).getLocationIndoor() + ":");
1042 
1043             }
1044             bw.close();
1045         } catch (IOException ex) {
1046             Logger.getLogger(mainDossierGUI.class.getName()).log(Level.SEVERE, null, ex);
1047         }
1048 
1049     }                                          
1050 
1051     private void openSpringMIMouseReleased(java.awt.event.MouseEvent evt) {                                           
1052         // TODO add your handling code here:
1053         JFileChooser jfc = new JFileChooser();
1054         //When the user releases the mouse from clicking "open spring"
1055         //This will open the document that the user required and show open dialog. 
1056         jfc.showOpenDialog(this);
1057         FileReader fr;
1058         try {
1059             fr = new FileReader(jfc.getSelectedFile());
1060 
1061             BufferedReader br = new BufferedReader(fr);
1062             String readIn = "";
1063 
1064             readIn = br.readLine();
1065             System.out.println(readIn);
1066             //String tokenizer allows the information to be outputted on the 
1067             //table with a ":" between the different information. 
1068             //The row begins to count at 0. 
1069             StringTokenizer st = new StringTokenizer(readIn, ":");
1070             int rowCounter = 0;
1071             while (st.hasMoreTokens()) {
1072                 //System.out.println(st.nextToken());
1073                 /*     public String vegetable = "not set yet";
1074                  public String fruit = "not set yet";
1075                  public String dateOfPlanting = "not set yet";
1076                  public boolean frost = true;
1077                  public String dateOfFrost = "not set yet";
1078                  public int amountOfSeeds = -999;
1079                  public boolean isIndoor = true;
1080                  public String comment = "not set yet";
1081                  public String locationIndoor = "not sey yet";
1082                  */
1083                 String vegetable = st.nextToken();  //1
1084 
1085                 String fruit = st.nextToken();  //2
1086 
1087                 String temp = st.nextToken();  //3
1088                 boolean frost = true;
1089                 if (temp.equals("false")) {
1090                     frost = false;
1091                 }
1092 
1093                 String dateOfPlanting = st.nextToken(); //4
1094 
1095                 String dateOfFrost = st.nextToken();   //5
1096 
1097                 int amountOfSeeds = Integer.parseInt(st.nextToken());
1098                 //6
1099                 String forIndoor = st.nextToken();
1100                 boolean isIndoor = true;
1101                 if (forIndoor.equals("false")) {   //7
1102                     isIndoor = false;
1103                 }
1104                 String comment = st.nextToken();  //8
1105 
1106                 String locationIndoor = st.nextToken();  //9
1107                 //<<<<-----
1108                 VagetableOrFruit Spring = new VagetableOrFruit(vegetable, fruit, dateOfPlanting,
1109                         frost, dateOfFrost, amountOfSeeds, isIndoor, comment, locationIndoor);
1110                 //<<<<-----
1111                 dossierForErcolinoList.add(Spring);
1112                 /*entryTableSpring.setValueAt(st.nextToken(), rowCounter, 0);
1113                  entryTableSpring.setValueAt(st.nextToken(), rowCounter, 1);
1114                  entryTableSpring.setValueAt(st.nextToken(), rowCounter, 2);
1115                  entryTableSpring.setValueAt(st.nextToken(), rowCounter, 3);
1116                  entryTableSpring.setValueAt(st.nextToken(), rowCounter, 4);
1117                  entryTableSpring.setValueAt(st.nextToken(), rowCounter, 5);
1118                  entryTableSpring.setValueAt(st.nextToken(), rowCounter, 6);
1119                  entryTableSpring.setValueAt(st.nextToken(), rowCounter, 7);
1120                  entryTableSpring.setValueAt(st.nextToken(), rowCounter, 8);
1121 
1122                  rowCounter++; */
1123             }
1124         } catch (FileNotFoundException ex) {
1125             Logger.getLogger(mainDossierGUI.class.getName()).log(Level.SEVERE, null, ex);
1126         } catch (IOException ex) {
1127             Logger.getLogger(mainDossierGUI.class.getName()).log(Level.SEVERE, null, ex);
1128         }
1129         
1130         refreshTableS();
1131 
1132     }
1133 
1134     public void refreshTableS() {
1135         //The table will be refreshed after "ok" button is released
1136         for (int i = 0; i < dossierForErcolinoList.size(); i++) {
1137             //System.out.println("i= " + i);
1138             entryTableSpring.setValueAt(dossierForErcolinoList.get(i).getVegetable(), i, 0);
1139             entryTableSpring.setValueAt(dossierForErcolinoList.get(i).getFruit(), i, 1);
1140             entryTableSpring.setValueAt(dossierForErcolinoList.get(i).getDateOfPlanting(), i, 2);
1141             entryTableSpring.setValueAt(dossierForErcolinoList.get(i).getFrost(), i, 3);
1142             entryTableSpring.setValueAt(dossierForErcolinoList.get(i).getDateOfFrost(), i, 4);
1143             entryTableSpring.setValueAt(dossierForErcolinoList.get(i).getAmountOfYield(), i, 5);
1144             //entryTable.setValueAt(dossierForErcolinoList.get(i).getAmountOfSeeds(), i, 5);
1145             entryTableSpring.setValueAt(dossierForErcolinoList.get(i).getIsIndoor(), i, 6);
1146             entryTableSpring.setValueAt(dossierForErcolinoList.get(i).getcomment(), i, 7);
1147             //entryTable.setValueAt(dossierForErcolinoList.get(i).getcomment(), i, 7);
1148             entryTableSpring.setValueAt(dossierForErcolinoList.get(i).getLocationIndoor(), i, 8);
1149 //entryTableOther.setValueAt(dossierForErcolinoList.get(i)., i, i);
1150         }
1151 
1152 
1153     }                                          
1154 
1155     private void SaveOtherMIMouseReleased(java.awt.event.MouseEvent evt) {                                          
1156         // TODO add your handling code here:
1157         //Save for "other" tab, the file is chosen and the save dialog will be shown
1158         JFileChooser jfc = new JFileChooser();
1159         jfc.showSaveDialog(this);
1160 // jfc.showOpenDialog(this);
1161         try {
1162             // TODO add your handling code here:
1163             FileWriter fw = new FileWriter(jfc.getSelectedFile());
1164             // FileWriter fw = new FileWriter("/Library/Application Support/ErcoFarm/practice.txt");
1165             BufferedWriter bw = new BufferedWriter(fw);
1166             //The information inputted will be saved in a text edit with ":" in between 
1167             //each different information
1168             for (int i = 0; i < dossierForErcolinoListOther.size(); i++) {
1169                 bw.write(dossierForErcolinoListOther.get(i).getOtherVegetable() + ":");
1170                 bw.write(dossierForErcolinoListOther.get(i).getOtherFruit() + ":");
1171                 bw.write(dossierForErcolinoListOther.get(i).getOtherDateOfPlanting() + ":");
1172                 bw.write(dossierForErcolinoListOther.get(i).getOtherAmountOfYield() + ":");
1173                 bw.write(dossierForErcolinoListOther.get(i).getOtherIsIndoor() + ":");
1174                 bw.write(dossierForErcolinoListOther.get(i).getotherLocationIndoor() + ":");
1175             }
1176             bw.close();
1177         } catch (IOException ex) {
1178             Logger.getLogger(mainDossierGUI.class.getName()).log(Level.SEVERE, null, ex);
1179         }
1180     }                                         
1181 
1182     private void openSpringMIActionPerformed(java.awt.event.ActionEvent evt) {                                             
1183 
1184     }                                            
1185 
1186     private void openOtherMIActionPerformed(java.awt.event.ActionEvent evt) {                                            
1187         // TODO add your handling code here:
1188     }                                           
1189 
1190     private void openOtherMIMouseReleased(java.awt.event.MouseEvent evt) {                                          
1191         // TODO add your handling code here:
1192         //Open for "other" tab, the file will be chosen by the user and it will be shown in 
1193         //the "other" table
1194         JFileChooser jfc = new JFileChooser();
1195         jfc.showOpenDialog(this);
1196         FileReader fr;
1197         try {
1198             fr = new FileReader(jfc.getSelectedFile());
1199 
1200             BufferedReader br = new BufferedReader(fr);
1201             String readIn = "";
1202 
1203             readIn = br.readLine();
1204             StringTokenizer st = new StringTokenizer(readIn, ":");
1205             //The data requested by user will be read and will be shown in table, 
1206             //String tokenizer allows the information to be outputted on the 
1207             //table with a ":" between the different information.
1208             while (st.hasMoreTokens()) {
1209                 /*otherVegetable = "not set yet";
1210                  public String otherFruit = "not set yet";
1211                  public String otherDateOfPlanting = "not set yet";
1212                  public int otherAmountOfSeeds = -999;
1213                  public boolean otherIsIndoor = true;
1214                  public String otherLocationIndoor = "not set yet";
1215                  */
1216                 //System.out.println(st.nextToken());
1217                 String otherVegetable = st.nextToken();
1218                 String otherFruit = st.nextToken();
1219                 String otherDateOfPlanting = st.nextToken();
1220                 int otherAmountOfSeeds = Integer.parseInt(st.nextToken());
1221                 String temp = st.nextToken();
1222                 boolean otherIsIndoor = true;
1223                 if (temp.equals("false")) {
1224                     otherIsIndoor = false;
1225                 }
1226                 String otherLocationIndoor = st.nextToken();
1227                 //<<<<----
1228                 VagetableOrFruit Other = new VagetableOrFruit(otherVegetable, otherFruit, otherDateOfPlanting,
1229                         otherAmountOfSeeds, otherIsIndoor, otherLocationIndoor);
1230 
1231                 dossierForErcolinoListOther.add(Other);
1232 
1233             }
1234         } catch (FileNotFoundException ex) {
1235             Logger.getLogger(mainDossierGUI.class.getName()).log(Level.SEVERE, null, ex);
1236         } catch (IOException ex) {
1237             Logger.getLogger(mainDossierGUI.class.getName()).log(Level.SEVERE, null, ex);
1238         }
1239 
1240         refreshTable();
1241     }                                         
1242 
1243     private void jTabbedPane1MouseReleased(java.awt.event.MouseEvent evt) {                                           
1244         // TODO add your handling code here:
1245         //  System.out.println("list is " + dossierForErcolinoList.size());
1246         /* for (int i = 0; i < dossierForErcolinoList.size() ; i++) {
1247          //System.out.println("i= " + i);
1248          entryTableSpring.setValueAt(dossierForErcolinoList.get(i).getVegetable(), i, 0);
1249          entryTableSpring.setValueAt(dossierForErcolinoList.get(i).getFruit(), i, 1);
1250          entryTableSpring.setValueAt(dossierForErcolinoList.get(i).getDateOfPlanting(), i, 2);
1251          entryTableSpring.setValueAt(dossierForErcolinoList.get(i).getFrost(), i, 3);
1252          entryTableSpring.setValueAt(dossierForErcolinoList.get(i).getDateOfFrost(), i, 4);
1253          entryTableSpring.setValueAt(dossierForErcolinoList.get(i).getAmountOfSeeds(), i, 5);
1254          //entryTable.setValueAt(dossierForErcolinoList.get(i).getAmountOfSeeds(), i, 5);
1255          entryTableSpring.setValueAt(dossierForErcolinoList.get(i).getIsIndoor(), i, 6);
1256          entryTableSpring.setValueAt(dossierForErcolinoList.get(i).getcomment(), i, 7);
1257          //entryTable.setValueAt(dossierForErcolinoList.get(i).getcomment(), i, 7);
1258          entryTableSpring.setValueAt(dossierForErcolinoList.get(i).getLocationIndoor(), i, 8);
1259          //entryTableOther.setValueAt(dossierForErcolinoList.get(i)., i, i);
1260          }
1261          for (int i = 0; i < dossierForErcolinoList.size() ; i++) {
1262 
1263          entryTableOther.setValueAt (dossierForErcolinoList.get(i).getOtherVegetable(), i, 0);
1264          entryTableOther.setValueAt(dossierForErcolinoList.get(i).getOtherFruit(), i, 1);
1265          entryTableOther.setValueAt(dossierForErcolinoList.get(i).getOtherDateOfPlanting(), i, 2);
1266          entryTableOther.setValueAt(dossierForErcolinoList.get(i).getOtherAmountOfSeeds(), i, 3);
1267          entryTableOther.setValueAt(dossierForErcolinoList.get(i).getOtherIsIndoor(), i, 4);
1268          entryTableOther.setValueAt(dossierForErcolinoList.get(i).getotherLocationIndoor(), i, 5);
1269          }*/
1270     }                                          
1271 
1272     private void displaySpringMouseReleased(java.awt.event.MouseEvent evt) {                                            
1273         // TODO add your handling code here:
1274         //This will output the different information inputted by user into the entryTableSpring
1275         
1276         for (int i = 0; i < dossierForErcolinoList.size(); i++) {
1277             //System.out.println("i= " + i);
1278             entryTableSpring.setValueAt(dossierForErcolinoList.get(i).getVegetable(), i, 0);
1279             entryTableSpring.setValueAt(dossierForErcolinoList.get(i).getFruit(), i, 1);
1280             entryTableSpring.setValueAt(dossierForErcolinoList.get(i).getDateOfPlanting(), i, 2);
1281             entryTableSpring.setValueAt(dossierForErcolinoList.get(i).getFrost(), i, 3);
1282             entryTableSpring.setValueAt(dossierForErcolinoList.get(i).getDateOfFrost(), i, 4);
1283             entryTableSpring.setValueAt(dossierForErcolinoList.get(i).getAmountOfYield(), i, 5);
1284             //entryTable.setValueAt(dossierForErcolinoList.get(i).getAmountOfSeeds(), i, 5);
1285             entryTableSpring.setValueAt(dossierForErcolinoList.get(i).getIsIndoor(), i, 6);
1286             entryTableSpring.setValueAt(dossierForErcolinoList.get(i).getcomment(), i, 7);
1287             //entryTable.setValueAt(dossierForErcolinoList.get(i).getcomment(), i, 7);
1288             entryTableSpring.setValueAt(dossierForErcolinoList.get(i).getLocationIndoor(), i, 8);
1289             //entryTableOther.setValueAt(dossierForErcolinoList.get(i)., i, i);
1290         }
1291     }                                           
1292 
1293     private void displayOtherMouseReleased(java.awt.event.MouseEvent evt) {                                           
1294         // TODO add your handling code here:
1295         //This will output the different information inputted by user into the entryTableOther
1296         for (int i = 0; i < dossierForErcolinoListOther.size(); i++) {
1297 
1298             entryTableOther.setValueAt(dossierForErcolinoListOther.get(i).getOtherVegetable(), i, 0);
1299             entryTableOther.setValueAt(dossierForErcolinoListOther.get(i).getOtherFruit(), i, 1);
1300             entryTableOther.setValueAt(dossierForErcolinoListOther.get(i).getOtherDateOfPlanting(), i, 2);
1301             entryTableOther.setValueAt(dossierForErcolinoListOther.get(i).getOtherAmountOfYield(), i, 3);
1302             entryTableOther.setValueAt(dossierForErcolinoListOther.get(i).getOtherIsIndoor(), i, 4);
1303             entryTableOther.setValueAt(dossierForErcolinoListOther.get(i).getotherLocationIndoor(), i, 5);
1304         }
1305     }                                          
1306 
1307     private void otherEntryButtonMouseReleased(java.awt.event.MouseEvent evt) {                                               
1308         // TODO add your handling code here:
1309         System.out.println("inside other button");
1310         boolean otherIsIndoor = true;
1311         if (otherIsIndoorRB.isSelected()) {
1312             otherIsIndoor = true;
1313 
1314         } else if (otherIsNotIndoorRB.isSelected()) {
1315             otherIsIndoor = false;
1316         }
1317         int otherAmountOfSeeds = Integer.parseInt(otherAmountYieldTF.getText());
1318         //vegetable, fruit, date of planting, amount of seeds, isindoor, indoorLocation.
1319         VagetableOrFruit Other = new VagetableOrFruit(otherVegetableCB.getSelectedItem() + "",
1320                 otherFruitCB.getSelectedItem() + "", otherDateOfPlantingTF.getText(), otherAmountOfSeeds,
1321                 otherIsIndoor, otherLocationIndoorCB.getSelectedItem() + "");
1322         //<<<<-----
1323         dossierForErcolinoListOther.add(Other);
1324         System.out.println("this is when one is added " + dossierForErcolinoListOther.get(0).getOtherDateOfPlanting());
1325         System.out.println("this is when one is added " + dossierForErcolinoListOther.get(0).getotherLocationIndoor());
1326 
1327         otherDateOfPlantingTF.setText("");
1328 
1329         otherAmountYieldTF.setText("");
1330         //The code under is an error tab that will pop up when no fruit or vegetable is selected for the "other" tab
1331         if (otherVegetableCB.getSelectedItem().equals("No Vegetables Today") && otherFruitCB.getSelectedItem().equals("No Fruit Today")) {
1332             JOptionPane.showMessageDialog(this,
1333                     "Error. you need to select a fruit or vegetable.",
1334                     "Warning",
1335                     JOptionPane.WARNING_MESSAGE);
1336         }
1337         //this is another error tab that will pop up when the user has selected both a fruit and a vegetable for the "other" tab
1338         //ie. when both items do not equal "no vegetable today" and "no fruit today" for the "other" tab
1339         if (!otherVegetableCB.getSelectedItem().equals("No Vegetables Today") && !otherFruitCB.getSelectedItem().equals("No Fruit Today")) {
1340             JOptionPane.showMessageDialog(this,
1341                     "Error. You can only work with fruits or vegetable.",
1342                     "Warning",
1343                     JOptionPane.WARNING_MESSAGE);
1344     }                                              
1345     }
1346     private void springEntryButtonActionPerformed(java.awt.event.ActionEvent evt) {                                                  
1347         // TODO add your handling code here:
1348     }                                                 
1349 
1350     private void springEntryButtonMouseReleased(java.awt.event.MouseEvent evt) {                                                
1351         // TODO add your handling code here:
1352         //
1353         boolean everythingIsCompleted = true;
1354         boolean frost = false;
1355         boolean isIndoor = true;
1356         int amountOfSeeds = 0;
1357         try {
1358 
1359             if (isNotFrostRB.isSelected()) {
1360                 frost = false;
1361 
1362             } else if (isFrostRB.isSelected()) {
1363                 frost = true;
1364 
1365             }
1366 
1367             if (springIsIndoorRB.isSelected()) {
1368                 isIndoor = true;
1369             } else if (springIsNotIndoorRB.isSelected()) {
1370                 isIndoor = false;
1371             }
1372 
1373             amountOfSeeds = Integer.parseInt(springAmountOfYieldTF.getText());
1374 
1375           
1376             ////The code under is an error tab that will pop up when no fruit or vegetable is selected for the "spring" tab
1377             if (SpringVegetableCB.getSelectedItem().equals("No vegetables today") && springFruitCB.getSelectedItem().equals("No fruits today")) {
1378                 JOptionPane.showMessageDialog(this,
1379                         "Error. you need to select a fruit of vegetable.",
1380                         "Warning",
1381                         JOptionPane.WARNING_MESSAGE);
1382                 everythingIsCompleted = false;
1383             }
1384            //this is another error tab that will pop up when the user has selected both a fruit and a vegetable for the "spring" tab
1385         //ie. when both items do not equal "no vegetable today" and "no fruit today" for the "spring" tab
1386             if (!SpringVegetableCB.getSelectedItem().equals("No vegetables today") && !springFruitCB.getSelectedItem().equals("No fruits today")) {
1387                 JOptionPane.showMessageDialog(this,
1388                         "Error. You can only work with fruits or vegetable.",
1389                         "Warning",
1390                         JOptionPane.WARNING_MESSAGE);
1391                 everythingIsCompleted = false;
1392             }
1393             //This is an error tab that will pop up if the "springDateOfPlantingTF" or "dateOfFrostTF"
1394             //or "commentTF" do not have any text inside
1395             if (springDateOfPlantingTF.getText().equals("")
1396                     || dateOfFrostTF.getText().equals("")
1397                     || commentTF.getText().equals("")) {
1398                 JOptionPane.showMessageDialog(this,
1399                         "Error. Make sure to add all information",
1400                         "Warning",
1401                         JOptionPane.WARNING_MESSAGE);
1402                 everythingIsCompleted = false;
1403             }
1404         } catch (NumberFormatException ex) {
1405             //This code is a pop up menu that will inform the user that the dates and grams
1406             //should be integers(numbers) rather than strings. 
1407             JOptionPane.showMessageDialog(this,
1408                     "Dates and grams should be numbers",
1409                     "Warning",
1410                     JOptionPane.WARNING_MESSAGE);
1411             everythingIsCompleted = false;
1412         }
1413         if (everythingIsCompleted) {
1414 
1415             VagetableOrFruit Spring = new VagetableOrFruit(SpringVegetableCB.getSelectedItem() + "",
1416                     springFruitCB.getSelectedItem() + "",
1417                     springDateOfPlantingTF.getText(),
1418                     frost,
1419                     dateOfFrostTF.getText(),
1420                     amountOfSeeds,
1421                     isIndoor,
1422                     commentTF.getText(),
1423                     springLocationIndoorCB.getSelectedItem() + "");
1424 
1425             dossierForErcolinoList.add(Spring);
1426             springDateOfPlantingTF.setText("");
1427             dateOfFrostTF.setText("");
1428             commentTF.setText("");
1429             springAmountOfYieldTF.setText("");
1430         }
1431     }                                               
1432 
1433     private void springLocationIndoorCBActionPerformed(java.awt.event.ActionEvent evt) {                                                       
1434         // TODO add your handling code here:
1435         System.out.println("");
1436     }                                                      
1437 
1438     private void springIsIndoorRBActionPerformed(java.awt.event.ActionEvent evt) {                                                 
1439         // TODO add your handling code here:
1440     }                                                
1441 
1442     private void dateOfFrostTFActionPerformed(java.awt.event.ActionEvent evt) {                                              
1443         // TODO add your handling code here:
1444     }                                             
1445 
1446     private void SpringVegetableCBActionPerformed(java.awt.event.ActionEvent evt) {                                                  
1447         // TODO add your handling code here:
1448     }                                                 
1449 
1450     private void springDateOfPlantingTFActionPerformed(java.awt.event.ActionEvent evt) {                                                       
1451         // TODO add your handling code here:
1452     }                                                      
1453 
1454     private void otherSearchButtonMouseReleased(java.awt.event.MouseEvent evt) {                                                
1455         // TODO add your handling code here:
1456         ArrayList<VagetableOrFruit> searchOtherResult = new ArrayList();
1457         String itemToSearchFor = otherSearchCB.getSelectedItem() + "";
1458         //This is a for loop for the "other" list that when the user inputs in the 
1459         //search tab, the item will be searched. 
1460         for (int i = 0; i < dossierForErcolinoListOther.size(); i++) {
1461             if (itemToSearchFor.equals(dossierForErcolinoListOther.get(i).getOtherFruit())) {
1462                 searchOtherResult.add(dossierForErcolinoListOther.get(i));
1463             }
1464         }
1465         for (int i = 0; i < 50; i++) {
1466             //System.out.println("i= " + i);
1467             //This code is clearing the text in the table when the i is less than 50
1468             searchTableOther.setValueAt("", i, 0);
1469             searchTableOther.setValueAt("", i, 1);
1470             searchTableOther.setValueAt("", i, 2);
1471             searchTableOther.setValueAt("", i, 3);
1472             searchTableOther.setValueAt("", i, 4);
1473             searchTableOther.setValueAt("", i, 5);
1474 
1475         }
1476         for (int i = 0; i < searchOtherResult.size(); i++) {
1477             //This code is outputting the info into the "searchTableOther" table
1478             searchTableOther.setValueAt(searchOtherResult.get(i).getOtherVegetable(), i, 0);
1479             searchTableOther.setValueAt(searchOtherResult.get(i).getOtherFruit(), i, 1);
1480             searchTableOther.setValueAt(searchOtherResult.get(i).getOtherDateOfPlanting(), i, 2);
1481             searchTableOther.setValueAt(searchOtherResult.get(i).getOtherAmountOfYield(), i, 3);
1482             searchTableOther.setValueAt(searchOtherResult.get(i).getOtherIsIndoor(), i, 4);
1483             searchTableOther.setValueAt(searchOtherResult.get(i).getotherLocationIndoor(), i, 5);
1484 
1485         }
1486     }                                               
1487 
1488     private void springSearchButtonMouseReleased(java.awt.event.MouseEvent evt) {                                                 
1489         // TODO add your handling code here:
1490         ArrayList<VagetableOrFruit> searchResults = new ArrayList();
1491         String itemToSearchFor = springVegetableSearchCB.getSelectedItem() + "";
1492         //   //This is a for loop for the "spring" list that when the user inputs in the 
1493         //search tab, the item will be searched. 
1494         for (int i = 0; i < dossierForErcolinoList.size(); i++) {
1495             if (itemToSearchFor.equals(dossierForErcolinoList.get(i).getVegetable())) {
1496 
1497                 searchResults.add(dossierForErcolinoList.get(i));
1498 
1499             }
1500 
1501       
1502         }
1503         //This code is clearing the text in the table when the i is less than 50
1504         for (int i = 0; i < 50; i++) {
1505             //System.out.println("i= " + i);
1506             springSearchTable.setValueAt("", i, 0);
1507             springSearchTable.setValueAt("", i, 1);
1508             springSearchTable.setValueAt("", i, 2);
1509             springSearchTable.setValueAt("", i, 3);
1510             springSearchTable.setValueAt("", i, 4);
1511             springSearchTable.setValueAt("", i, 5);
1512             //entryTable.setValueAt(dossierForErcolinoList.get(i).getAmountOfSeeds(), i, 5);
1513             springSearchTable.setValueAt("", i, 6);
1514             springSearchTable.setValueAt("", i, 7);
1515             //entryTable.setValueAt(dossierForErcolinoList.get(i).getcomment(), i, 7);
1516             springSearchTable.setValueAt("", i, 8);
1517             //entryTableOther.setValueAt(dossierForErcolinoList.get(i)., i, i);
1518         }
1519        //This code is outputting the info into the "searchTableOther" table, after 
1520         //it has been searched for.
1521         for (int i = 0; i < searchResults.size(); i++) {
1522             //System.out.println("i= " + i);
1523             springSearchTable.setValueAt(searchResults.get(i).getVegetable(), i, 0);
1524             springSearchTable.setValueAt(searchResults.get(i).getFruit(), i, 1);
1525             springSearchTable.setValueAt(searchResults.get(i).getDateOfPlanting(), i, 2);
1526             springSearchTable.setValueAt(searchResults.get(i).getFrost(), i, 3);
1527             springSearchTable.setValueAt(searchResults.get(i).getDateOfFrost(), i, 4);
1528             springSearchTable.setValueAt(searchResults.get(i).getAmountOfYield(), i, 5);
1529             //entryTable.setValueAt(dossierForErcolinoList.get(i).getAmountOfSeeds(), i, 5);
1530             springSearchTable.setValueAt(searchResults.get(i).getIsIndoor(), i, 6);
1531             springSearchTable.setValueAt(searchResults.get(i).getcomment(), i, 7);
1532             //entryTable.setValueAt(dossierForErcolinoList.get(i).getcomment(), i, 7);
1533             springSearchTable.setValueAt(searchResults.get(i).getLocationIndoor(), i, 8);
1534             //entryTableOther.setValueAt(dossierForErcolinoList.get(i)., i, i);
1535         }
1536     }                                                
1537 //make new arraylist
1538 //get selected item from combobox
1539     //search through arraylist
1540     //add new array list everytime fruit of vegetable = the one to the combo box
1541     //
1542 
1543     public void refreshTable() {
1544         //<<<<-----
1545         for (int i = 0; i < dossierForErcolinoListOther.size(); i++) {
1546 
1547             entryTableOther.setValueAt(dossierForErcolinoListOther.get(i).getOtherVegetable(), i, 0);
1548             entryTableOther.setValueAt(dossierForErcolinoListOther.get(i).getOtherFruit(), i, 1);
1549             entryTableOther.setValueAt(dossierForErcolinoListOther.get(i).getOtherDateOfPlanting(), i, 2);
1550             entryTableOther.setValueAt(dossierForErcolinoListOther.get(i).getOtherAmountOfYield(), i, 3);
1551             entryTableOther.setValueAt(dossierForErcolinoListOther.get(i).getOtherIsIndoor(), i, 4);
1552             entryTableOther.setValueAt(dossierForErcolinoListOther.get(i).getotherLocationIndoor(), i, 5);
1553         }
1554 
1555     }
1556 
1557     /**
1558      * @param args the command line arguments
1559      */
1560     public static void main(String args[]) {
1561         /* Set the Nimbus look and feel */
1562         //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
1563         /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
1564          * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
1565          */
1566         try {
1567             for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
1568                 if ("Nimbus".equals(info.getName())) {
1569                     javax.swing.UIManager.setLookAndFeel(info.getClassName());
1570                     break;
1571                 }
1572             }
1573         } catch (ClassNotFoundException ex) {
1574             java.util.logging.Logger.getLogger(mainDossierGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
1575         } catch (InstantiationException ex) {
1576             java.util.logging.Logger.getLogger(mainDossierGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
1577         } catch (IllegalAccessException ex) {
1578             java.util.logging.Logger.getLogger(mainDossierGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
1579         } catch (javax.swing.UnsupportedLookAndFeelException ex) {
1580             java.util.logging.Logger.getLogger(mainDossierGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
1581         }
1582         //</editor-fold>
1583 
1584         /* Create and display the form */
1585         java.awt.EventQueue.invokeLater(new Runnable() {
1586             public void run() {
1587                 new mainDossierGUI().setVisible(true);
1588             }
1589         });
1590     }
1591 

 

 

 

 


//AUTO GENERATED BY NETBEANS FROM THIS POINT ON

80     @SuppressWarnings("unchecked")
  81     // <editor-fold defaultstate="collapsed" desc="Generated Code">                          
  82     private void initComponents() {
  83 
  84         jMenuBar1 = new javax.swing.JMenuBar();
  85         jMenu1 = new javax.swing.JMenu();
  86         jMenu2 = new javax.swing.JMenu();
  87         buttonGroup1 = new javax.swing.ButtonGroup();
  88         buttonGroup2 = new javax.swing.ButtonGroup();
  89         buttonGroup3 = new javax.swing.ButtonGroup();
  90         jMenu3 = new javax.swing.JMenu();
  91         buttonGroup4 = new javax.swing.ButtonGroup();
  92         buttonGroup5 = new javax.swing.ButtonGroup();
  93         buttonGroup6 = new javax.swing.ButtonGroup();
  94         buttonGroup7 = new javax.swing.ButtonGroup();
  95         otherSearchTable1 = new javax.swing.JScrollPane();
  96         searchTableOther1 = new javax.swing.JTable();
  97         jTabbedPane1 = new javax.swing.JTabbedPane();
  98         jPanel1 = new javax.swing.JPanel();
  99         jLabel1 = new javax.swing.JLabel();
 100         jLabel2 = new javax.swing.JLabel();
 101         jLabel3 = new javax.swing.JLabel();
 102         springDateOfPlantingTF = new javax.swing.JTextField();
 103         springAmountOfYieldTF = new javax.swing.JTextField();
 104         SpringVegetableCB = new javax.swing.JComboBox();
 105         jSeparator1 = new javax.swing.JSeparator();
 106         jLabel17 = new javax.swing.JLabel();
 107         springFruitCB = new javax.swing.JComboBox();
 108         jLabel18 = new javax.swing.JLabel();
 109         jLabel19 = new javax.swing.JLabel();
 110         isFrostRB = new javax.swing.JRadioButton();
 111         jLabel20 = new javax.swing.JLabel();
 112         dateOfFrostTF = new javax.swing.JTextField();
 113         isNotFrostRB = new javax.swing.JRadioButton();
 114         jLabel22 = new javax.swing.JLabel();
 115         springIsIndoorRB = new javax.swing.JRadioButton();
 116         springIsNotIndoorRB = new javax.swing.JRadioButton();
 117         springLocationIndoorCB = new javax.swing.JComboBox();
 118         jLabel21 = new javax.swing.JLabel();
 119         jLabel23 = new javax.swing.JLabel();
 120         jLabel7 = new javax.swing.JLabel();
 121         commentTF = new javax.swing.JTextField();
 122         jLabel41 = new javax.swing.JLabel();
 123         springEntryButton = new javax.swing.JButton();
 124         jPanel3 = new javax.swing.JPanel();
 125         jPanel2 = new javax.swing.JPanel();
 126         jLabel4 = new javax.swing.JLabel();
 127         jLabel5 = new javax.swing.JLabel();
 128         jLabel6 = new javax.swing.JLabel();
 129         otherDateOfPlantingTF = new javax.swing.JTextField();
 130         otherAmountYieldTF = new javax.swing.JTextField();
 131         otherVegetableCB = new javax.swing.JComboBox();
 132         jLabel13 = new javax.swing.JLabel();
 133         jButton2 = new javax.swing.JButton();
 134         jSeparator2 = new javax.swing.JSeparator();
 135         jLabel28 = new javax.swing.JLabel();
 136         otherFruitCB = new javax.swing.JComboBox();
 137         jLabel29 = new javax.swing.JLabel();
 138         jLabel34 = new javax.swing.JLabel();
 139         otherIsIndoorRB = new javax.swing.JRadioButton();
 140         otherIsNotIndoorRB = new javax.swing.JRadioButton();
 141         otherLocationIndoorCB = new javax.swing.JComboBox();
 142         jLabel35 = new javax.swing.JLabel();
 143         otherEntryButton = new javax.swing.JButton();
 144         jPanel4 = new javax.swing.JPanel();
 145         jScrollPane3 = new javax.swing.JScrollPane();
 146         entryTableSpring = new javax.swing.JTable();
 147         jScrollPane4 = new javax.swing.JScrollPane();
 148         entryTableOther = new javax.swing.JTable();
 149         displayOther = new javax.swing.JButton();
 150         displaySpring = new javax.swing.JButton();
 151         jPanel5 = new javax.swing.JPanel();
 152         jScrollPane5 = new javax.swing.JScrollPane();
 153         springSearchTable = new javax.swing.JTable();
 154         otherSearchTable = new javax.swing.JScrollPane();
 155         searchTableOther = new javax.swing.JTable();
 156         springVegetableSearchCB = new javax.swing.JComboBox();
 157         jLabel9 = new javax.swing.JLabel();
 158         otherSearchCB = new javax.swing.JComboBox();
 159         springSearchButton = new javax.swing.JButton();
 160         jLabel11 = new javax.swing.JLabel();
 161         otherSearchButton = new javax.swing.JButton();
 162         menuBar = new javax.swing.JMenuBar();
 163         fileMenu = new javax.swing.JMenu();
 164         openSpringMI = new javax.swing.JMenuItem();
 165         saveSpringMI = new javax.swing.JMenuItem();
 166         SaveOtherMI = new javax.swing.JMenuItem();
 167         saveAsMenuItem = new javax.swing.JMenuItem();
 168         exitMenuItem = new javax.swing.JMenuItem();
 169         openOtherMI = new javax.swing.JMenuItem();
 170         editMenu = new javax.swing.JMenu();
 171         cutMenuItem = new javax.swing.JMenuItem();
 172         copyMenuItem = new javax.swing.JMenuItem();
 173         pasteMenuItem = new javax.swing.JMenuItem();
 174         deleteMenuItem = new javax.swing.JMenuItem();
 175         helpMenu = new javax.swing.JMenu();
 176         contentsMenuItem = new javax.swing.JMenuItem();
 177         aboutMenuItem = new javax.swing.JMenuItem();
 178 
 179         jMenu1.setText("File");
 180         jMenuBar1.add(jMenu1);
 181 
 182         jMenu2.setText("Edit");
 183         jMenuBar1.add(jMenu2);
 184 
 185         jMenu3.setText("jMenu3");
 186 
 187         searchTableOther1.setModel(new javax.swing.table.DefaultTableModel(
 188             new Object [][] {
 189                 {null, null, null, null, null, null},
 190                 {null, null, null, null, null, null},
 191                 {null, null, null, null, null, null},
 192                 {null, null, null, null, null, null},
 193                 {null, null, null, null, null, null},
 194                 {null, null, null, null, null, null},
 195                 {null, null, null, null, null, null},
 196                 {null, null, null, null, null, null},
 197                 {null, null, null, null, null, null},
 198                 {null, null, null, null, null, null},
 199                 {null, null, null, null, null, null},
 200                 {null, null, null, null, null, null},
 201                 {null, null, null, null, null, null},
 202                 {null, null, null, null, null, null},
 203                 {null, null, null, null, null, null},
 204                 {null, null, null, null, null, null},
 205                 {null, null, null, null, null, null},
 206                 {null, null, null, null, null, null},
 207                 {null, null, null, null, null, null},
 208                 {null, null, null, null, null, null},
 209                 {null, null, null, null, null, null},
 210                 {null, null, null, null, null, null},
 211                 {null, null, null, null, null, null},
 212                 {null, null, null, null, null, null},
 213                 {null, null, null, null, null, null},
 214                 {null, null, null, null, null, null},
 215                 {null, null, null, null, null, null},
 216                 {null, null, null, null, null, null},
 217                 {null, null, null, null, null, null},
 218                 {null, null, null, null, null, null},
 219                 {null, null, null, null, null, null},
 220                 {null, null, null, null, null, null},
 221                 {null, null, null, null, null, null},
 222                 {null, null, null, null, null, null},
 223                 {null, null, null, null, null, null},
 224                 {null, null, null, null, null, null},
 225                 {null, null, null, null, null, null},
 226                 {null, null, null, null, null, null},
 227                 {null, null, null, null, null, null},
 228                 {null, null, null, null, null, null},
 229                 {null, null, null, null, null, null},
 230                 {null, null, null, null, null, null},
 231                 {null, null, null, null, null, null},
 232                 {null, null, null, null, null, null},
 233                 {null, null, null, null, null, null},
 234                 {null, null, null, null, null, null},
 235                 {null, null, null, null, null, null},
 236                 {null, null, null, null, null, null},
 237                 {null, null, null, null, null, null},
 238                 {null, null, null, null, null, null}
 239             },
 240             new String [] {
 241                 "Vegetable", "Fruit", "Planting date", "Amount of Seeds", "Is indoor", "Location "
 242             }
 243         ));
 244         otherSearchTable1.setViewportView(searchTableOther1);
 245 
 246         setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
 247 
 248         jTabbedPane1.addMouseListener(new java.awt.event.MouseAdapter() {
 249             public void mouseReleased(java.awt.event.MouseEvent evt) {
 250                 jTabbedPane1MouseReleased(evt);
 251             }
 252         });
 253 
 254         jLabel1.setText("Planted Vegetable ");
 255 
 256         jLabel2.setText("Amount of yield (g)");
 257 
 258         jLabel3.setText("Date of planting");
 259 
 260         springDateOfPlantingTF.addActionListener(new java.awt.event.ActionListener() {
 261             public void actionPerformed(java.awt.event.ActionEvent evt) {
 262                 springDateOfPlantingTFActionPerformed(evt);
 263             }
 264         });
 265 
 266         SpringVegetableCB.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "No vegetables today", "Broccoli", "Zuchini", "Carrot", "Legumes" }));
 267         SpringVegetableCB.addActionListener(new java.awt.event.ActionListener() {
 268             public void actionPerformed(java.awt.event.ActionEvent evt) {
 269                 SpringVegetableCBActionPerformed(evt);
 270             }
 271         });
 272 
 273         jLabel17.setText("Planted Fruit");
 274 
 275         springFruitCB.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "No fruits today", "Strawberries", "Grapes", "Apple", "Banana", " " }));
 276 
 277         jLabel18.setText("dd/mm/year");
 278 
 279         jLabel19.setText("Frost");
 280 
 281         isFrostRB.setText("Yes");
 282 
 283         jLabel20.setText("date of frost:");
 284 
 285         dateOfFrostTF.addActionListener(new java.awt.event.ActionListener() {
 286             public void actionPerformed(java.awt.event.ActionEvent evt) {
 287                 dateOfFrostTFActionPerformed(evt);
 288             }
 289         });
 290 
 291         isNotFrostRB.setText("No");
 292 
 293         jLabel22.setText("Location of planting");
 294 
 295         springIsIndoorRB.setText("Indoor");
 296         springIsIndoorRB.addActionListener(new java.awt.event.ActionListener() {
 297             public void actionPerformed(java.awt.event.ActionEvent evt) {
 298                 springIsIndoorRBActionPerformed(evt);
 299             }
 300         });
 301 
 302         springIsNotIndoorRB.setText("Outdoor");
 303 
 304         springLocationIndoorCB.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "small", "medium", "big", " " }));
 305         springLocationIndoorCB.addActionListener(new java.awt.event.ActionListener() {
 306             public void actionPerformed(java.awt.event.ActionEvent evt) {
 307                 springLocationIndoorCBActionPerformed(evt);
 308             }
 309         });
 310 
 311         jLabel21.setText("If location is Indoor: select location in field");
 312 
 313         jLabel23.setText("If yes write:");
 314 
 315         jLabel7.setText("Comments:");
 316 
 317         jLabel41.setText("dd/mm/year");
 318 
 319         springEntryButton.setText("Ok");
 320         springEntryButton.addMouseListener(new java.awt.event.MouseAdapter() {
 321             public void mouseReleased(java.awt.event.MouseEvent evt) {
 322                 springEntryButtonMouseReleased(evt);
 323             }
 324         });
 325         springEntryButton.addActionListener(new java.awt.event.ActionListener() {
 326             public void actionPerformed(java.awt.event.ActionEvent evt) {
 327                 springEntryButtonActionPerformed(evt);
 328             }
 329         });
 330 
 331         javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
 332         jPanel1.setLayout(jPanel1Layout);
 333         jPanel1Layout.setHorizontalGroup(
 334             jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 335             .addGroup(jPanel1Layout.createSequentialGroup()
 336                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 337                     .addGroup(jPanel1Layout.createSequentialGroup()
 338                         .addGap(41, 41, 41)
 339                         .addComponent(jLabel19)
 340                         .addGap(27, 27, 27)
 341                         .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 342                             .addGroup(jPanel1Layout.createSequentialGroup()
 343                                 .addComponent(isFrostRB)
 344                                 .addGap(18, 18, 18)
 345                                 .addComponent(jLabel23)
 346                                 .addGap(18, 18, 18)
 347                                 .addComponent(jLabel20)
 348                                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
 349                                 .addComponent(dateOfFrostTF, javax.swing.GroupLayout.PREFERRED_SIZE, 118, javax.swing.GroupLayout.PREFERRED_SIZE)
 350                                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
 351                                 .addComponent(jLabel41))
 352                             .addComponent(isNotFrostRB)))
 353                     .addGroup(jPanel1Layout.createSequentialGroup()
 354                         .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 355                             .addGroup(jPanel1Layout.createSequentialGroup()
 356                                 .addGap(21, 21, 21)
 357                                 .addComponent(jLabel1))
 358                             .addGroup(jPanel1Layout.createSequentialGroup()
 359                                 .addGap(42, 42, 42)
 360                                 .addComponent(jLabel17)))
 361                         .addGap(18, 18, 18)
 362                         .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 363                             .addComponent(springFruitCB, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
 364                             .addComponent(SpringVegetableCB, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
 365                     .addGroup(jPanel1Layout.createSequentialGroup()
 366                         .addContainerGap()
 367                         .addComponent(jLabel3)
 368                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
 369                         .addComponent(springDateOfPlantingTF, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE)
 370                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 371                         .addComponent(jLabel18))
 372                     .addGroup(jPanel1Layout.createSequentialGroup()
 373                         .addContainerGap()
 374                         .addComponent(jLabel2)
 375                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 376                         .addComponent(springAmountOfYieldTF, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE))
 377                     .addGroup(jPanel1Layout.createSequentialGroup()
 378                         .addGap(13, 13, 13)
 379                         .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 380                             .addGroup(jPanel1Layout.createSequentialGroup()
 381                                 .addComponent(jLabel22)
 382                                 .addGap(18, 18, 18)
 383                                 .addComponent(springIsIndoorRB)
 384                                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 385                                 .addComponent(springIsNotIndoorRB))
 386                             .addGroup(jPanel1Layout.createSequentialGroup()
 387                                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 388                                     .addGroup(jPanel1Layout.createSequentialGroup()
 389                                         .addGap(22, 22, 22)
 390                                         .addComponent(jLabel21)
 391                                         .addGap(39, 39, 39)
 392                                         .addComponent(springLocationIndoorCB, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
 393                                     .addGroup(jPanel1Layout.createSequentialGroup()
 394                                         .addGap(32, 32, 32)
 395                                         .addComponent(jLabel7)
 396                                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 397                                         .addComponent(commentTF, javax.swing.GroupLayout.PREFERRED_SIZE, 118, javax.swing.GroupLayout.PREFERRED_SIZE)))
 398                                 .addGap(38, 38, 38)
 399                                 .addComponent(springEntryButton)
 400                                 .addGap(124, 124, 124)
 401                                 .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)))))
 402                 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
 403         );
 404         jPanel1Layout.setVerticalGroup(
 405             jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 406             .addGroup(jPanel1Layout.createSequentialGroup()
 407                 .addGap(27, 27, 27)
 408                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
 409                     .addComponent(jLabel1)
 410                     .addComponent(SpringVegetableCB, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
 411                 .addGap(6, 6, 6)
 412                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
 413                     .addComponent(jLabel17)
 414                     .addComponent(springFruitCB, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
 415                 .addGap(10, 10, 10)
 416                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
 417                     .addComponent(jLabel3)
 418                     .addComponent(springDateOfPlantingTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
 419                     .addComponent(jLabel18))
 420                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
 421                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
 422                     .addComponent(jLabel19)
 423                     .addComponent(isFrostRB)
 424                     .addComponent(jLabel20)
 425                     .addComponent(dateOfFrostTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
 426                     .addComponent(jLabel23)
 427                     .addComponent(jLabel41))
 428                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 429                 .addComponent(isNotFrostRB)
 430                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
 431                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
 432                     .addComponent(jLabel2)
 433                     .addComponent(springAmountOfYieldTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
 434                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 435                     .addGroup(jPanel1Layout.createSequentialGroup()
 436                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
 437                         .addComponent(springEntryButton)
 438                         .addGap(111, 111, 111))
 439                     .addGroup(jPanel1Layout.createSequentialGroup()
 440                         .addGap(34, 34, 34)
 441                         .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
 442                             .addComponent(jLabel22)
 443                             .addComponent(springIsIndoorRB)
 444                             .addComponent(springIsNotIndoorRB))
 445                         .addGap(18, 18, 18)
 446                         .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
 447                             .addComponent(jLabel7)
 448                             .addComponent(commentTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
 449                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 103, Short.MAX_VALUE)
 450                         .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
 451                             .addComponent(springLocationIndoorCB, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
 452                             .addComponent(jLabel21))
 453                         .addGap(84, 84, 84)
 454                         .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
 455                         .addContainerGap())))
 456         );
 457 
 458         jTabbedPane1.addTab("Spring", jPanel1);
 459 
 460         jLabel4.setText("Planted Vegetable ");
 461 
 462         jLabel5.setText("Amount of yield (g)");
 463 
 464         jLabel6.setText("Date of planting");
 465 
 466         otherVegetableCB.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "No Vegetables Today", "Beets", "Carrots", "Cauliflower", "Celery", "Potatoes", "Beans", "Cucumbre", "Eggplant", "Corn", "Sweet potatoes", "Tomatoes" }));
 467 
 468         jLabel13.setText("g");
 469 
 470         jButton2.setText("Ok");
 471 
 472         jLabel28.setText("Planted Fruit");
 473 
 474         otherFruitCB.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "No Fruit Today", "Kiwis", "Mandarines", "Oranges", "Pears", "Pommelos", "Tangerines" }));
 475 
 476         jLabel29.setText("dd/mm/year");
 477 
 478         jLabel34.setText("Location of planting");
 479 
 480         otherIsIndoorRB.setText("Indoor");
 481 
 482         otherIsNotIndoorRB.setText("Outdoor");
 483 
 484         otherLocationIndoorCB.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
 485 
 486         jLabel35.setText("If location is Indoor: select location in field");
 487 
 488         otherEntryButton.setText("Ok");
 489         otherEntryButton.addMouseListener(new java.awt.event.MouseAdapter() {
 490             public void mouseReleased(java.awt.event.MouseEvent evt) {
 491                 otherEntryButtonMouseReleased(evt);
 492             }
 493         });
 494 
 495         javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
 496         jPanel2.setLayout(jPanel2Layout);
 497         jPanel2Layout.setHorizontalGroup(
 498             jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 499             .addGroup(jPanel2Layout.createSequentialGroup()
 500                 .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 501                     .addGroup(jPanel2Layout.createSequentialGroup()
 502                         .addGap(17, 17, 17)
 503                         .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
 504                             .addGroup(jPanel2Layout.createSequentialGroup()
 505                                 .addComponent(jLabel4)
 506                                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 507                                 .addComponent(otherVegetableCB, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
 508                             .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
 509                                 .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 510                                     .addGroup(jPanel2Layout.createSequentialGroup()
 511                                         .addGap(6, 6, 6)
 512                                         .addComponent(jLabel28)
 513                                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
 514                                     .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
 515                                         .addComponent(jLabel6)
 516                                         .addGap(18, 18, 18)))
 517                                 .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 518                                     .addComponent(otherFruitCB, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
 519                                     .addGroup(jPanel2Layout.createSequentialGroup()
 520                                         .addComponent(otherDateOfPlantingTF, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE)
 521                                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 522                                         .addComponent(jLabel29)))))
 523                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
 524                         .addComponent(jButton2))
 525                     .addGroup(jPanel2Layout.createSequentialGroup()
 526                         .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 527                             .addGroup(jPanel2Layout.createSequentialGroup()
 528                                 .addGap(35, 35, 35)
 529                                 .addComponent(jLabel35)
 530                                 .addGap(39, 39, 39)
 531                                 .addComponent(otherLocationIndoorCB, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
 532                             .addGroup(jPanel2Layout.createSequentialGroup()
 533                                 .addGap(13, 13, 13)
 534                                 .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 535                                     .addGroup(jPanel2Layout.createSequentialGroup()
 536                                         .addGap(688, 688, 688)
 537                                         .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))
 538                                     .addGroup(jPanel2Layout.createSequentialGroup()
 539                                         .addComponent(jLabel34)
 540                                         .addGap(18, 18, 18)
 541                                         .addComponent(otherIsIndoorRB)
 542                                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 543                                         .addComponent(otherIsNotIndoorRB)))))
 544                         .addGap(0, 0, Short.MAX_VALUE)))
 545                 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
 546             .addGroup(jPanel2Layout.createSequentialGroup()
 547                 .addContainerGap()
 548                 .addComponent(jLabel5)
 549                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 550                 .addComponent(otherAmountYieldTF, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE)
 551                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 552                 .addComponent(jLabel13)
 553                 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
 554             .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
 555                 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
 556                 .addComponent(otherEntryButton)
 557                 .addGap(208, 208, 208))
 558         );
 559         jPanel2Layout.setVerticalGroup(
 560             jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 561             .addGroup(jPanel2Layout.createSequentialGroup()
 562                 .addGap(30, 30, 30)
 563                 .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
 564                     .addComponent(jLabel4)
 565                     .addComponent(otherVegetableCB, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
 566                     .addComponent(jButton2))
 567                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 568                 .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 569                     .addComponent(jLabel28)
 570                     .addComponent(otherFruitCB, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
 571                 .addGap(28, 28, 28)
 572                 .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
 573                     .addComponent(jLabel29)
 574                     .addComponent(otherDateOfPlantingTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
 575                     .addComponent(jLabel6))
 576                 .addGap(37, 37, 37)
 577                 .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
 578                     .addComponent(jLabel5)
 579                     .addComponent(otherAmountYieldTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
 580                     .addComponent(jLabel13))
 581                 .addGap(40, 40, 40)
 582                 .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
 583                     .addComponent(jLabel34)
 584                     .addComponent(otherIsIndoorRB)
 585                     .addComponent(otherIsNotIndoorRB))
 586                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 34, Short.MAX_VALUE)
 587                 .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
 588                     .addComponent(otherLocationIndoorCB, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
 589                     .addComponent(jLabel35))
 590                 .addGap(41, 41, 41)
 591                 .addComponent(otherEntryButton)
 592                 .addGap(14, 14, 14)
 593                 .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
 594                 .addContainerGap())
 595         );
 596 
 597         javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
 598         jPanel3.setLayout(jPanel3Layout);
 599         jPanel3Layout.setHorizontalGroup(
 600             jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 601             .addGroup(jPanel3Layout.createSequentialGroup()
 602                 .addContainerGap()
 603                 .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
 604                 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
 605         );
 606         jPanel3Layout.setVerticalGroup(
 607             jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 608             .addGroup(jPanel3Layout.createSequentialGroup()
 609                 .addContainerGap()
 610                 .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
 611                 .addContainerGap(124, Short.MAX_VALUE))
 612         );
 613 
 614         jTabbedPane1.addTab("Other", jPanel3);
 615 
 616         entryTableSpring.setModel(new javax.swing.table.DefaultTableModel(
 617             new Object [][] {
 618                 {null, null, null, null, null, null, null, null, null},
 619                 {null, null, null, null, null, null, null, null, null},
 620                 {null, null, null, null, null, null, null, null, null},
 621                 {null, null, null, null, null, null, null, null, null},
 622                 {null, null, null, null, null, null, null, null, null},
 623                 {null, null, null, null, null, null, null, null, null},
 624                 {null, null, null, null, null, null, null, null, null},
 625                 {null, null, null, null, null, null, null, null, null},
 626                 {null, null, null, null, null, null, null, null, null},
 627                 {null, null, null, null, null, null, null, null, null},
 628                 {null, null, null, null, null, null, null, null, null},
 629                 {null, null, null, null, null, null, null, null, null},
 630                 {null, null, null, null, null, null, null, null, null},
 631                 {null, null, null, null, null, null, null, null, null}
 632             },
 633             new String [] {
 634                 "Vegetable", "Fruit", "Planting Date", "Is frost", "Date of Frost", "Amount of seeds", "Is Indoor", "Comment", "Location"
 635             }
 636         ));
 637         jScrollPane3.setViewportView(entryTableSpring);
 638 
 639         entryTableOther.setModel(new javax.swing.table.DefaultTableModel(
 640             new Object [][] {
 641                 {null, null, null, null, null, null},
 642                 {null, null, null, null, null, null},
 643                 {null, null, null, null, null, null},
 644                 {null, null, null, null, null, null},
 645                 {null, null, null, null, null, null},
 646                 {null, null, null, null, null, null},
 647                 {null, null, null, null, null, null},
 648                 {null, null, null, null, null, null},
 649                 {null, null, null, null, null, null},
 650                 {null, null, null, null, null, null},
 651                 {null, null, null, null, null, null},
 652                 {null, null, null, null, null, null}
 653             },
 654             new String [] {
 655                 "Vegetable", "Fruit", "Planting date", "Amount of Seeds", "Is indoor", "Location "
 656             }
 657         ));
 658         jScrollPane4.setViewportView(entryTableOther);
 659 
 660         displayOther.setText("Display Info for Other");
 661         displayOther.addMouseListener(new java.awt.event.MouseAdapter() {
 662             public void mouseReleased(java.awt.event.MouseEvent evt) {
 663                 displayOtherMouseReleased(evt);
 664             }
 665         });
 666 
 667         displaySpring.setText("Display Info for Spring");
 668         displaySpring.addMouseListener(new java.awt.event.MouseAdapter() {
 669             public void mouseReleased(java.awt.event.MouseEvent evt) {
 670                 displaySpringMouseReleased(evt);
 671             }
 672         });
 673 
 674         javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
 675         jPanel4.setLayout(jPanel4Layout);
 676         jPanel4Layout.setHorizontalGroup(
 677             jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 678             .addComponent(jScrollPane3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 625, Short.MAX_VALUE)
 679             .addComponent(jScrollPane4)
 680             .addGroup(jPanel4Layout.createSequentialGroup()
 681                 .addGap(34, 34, 34)
 682                 .addComponent(displayOther)
 683                 .addGap(164, 164, 164)
 684                 .addComponent(displaySpring)
 685                 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
 686         );
 687         jPanel4Layout.setVerticalGroup(
 688             jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 689             .addGroup(jPanel4Layout.createSequentialGroup()
 690                 .addGap(20, 20, 20)
 691                 .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
 692                     .addComponent(displaySpring)
 693                     .addComponent(displayOther))
 694                 .addGap(18, 18, 18)
 695                 .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 195, javax.swing.GroupLayout.PREFERRED_SIZE)
 696                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 697                 .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 196, javax.swing.GroupLayout.PREFERRED_SIZE)
 698                 .addContainerGap())
 699         );
 700 
 701         jTabbedPane1.addTab("Info", jPanel4);
 702 
 703         springSearchTable.setModel(new javax.swing.table.DefaultTableModel(
 704             new Object [][] {
 705                 {null, null, null, null, null, null, null, null, null},
 706                 {null, null, null, null, null, null, null, null, null},
 707                 {null, null, null, null, null, null, null, null, null},
 708                 {null, null, null, null, null, null, null, null, null},
 709                 {null, null, null, null, null, null, null, null, null},
 710                 {null, null, null, null, null, null, null, null, null},
 711                 {null, null, null, null, null, null, null, null, null},
 712                 {null, null, null, null, null, null, null, null, null},
 713                 {null, null, null, null, null, null, null, null, null},
 714                 {null, null, null, null, null, null, null, null, null},
 715                 {null, null, null, null, null, null, null, null, null},
 716                 {null, null, null, null, null, null, null, null, null},
 717                 {null, null, null, null, null, null, null, null, null},
 718                 {null, null, null, null, null, null, null, null, null},
 719                 {null, null, null, null, null, null, null, null, null},
 720                 {null, null, null, null, null, null, null, null, null},
 721                 {null, null, null, null, null, null, null, null, null},
 722                 {null, null, null, null, null, null, null, null, null},
 723                 {null, null, null, null, null, null, null, null, null},
 724                 {null, null, null, null, null, null, null, null, null},
 725                 {null, null, null, null, null, null, null, null, null},
 726                 {null, null, null, null, null, null, null, null, null},
 727                 {null, null, null, null, null, null, null, null, null},
 728                 {null, null, null, null, null, null, null, null, null},
 729                 {null, null, null, null, null, null, null, null, null},
 730                 {null, null, null, null, null, null, null, null, null},
 731                 {null, null, null, null, null, null, null, null, null},
 732                 {null, null, null, null, null, null, null, null, null},
 733                 {null, null, null, null, null, null, null, null, null},
 734                 {null, null, null, null, null, null, null, null, null},
 735                 {null, null, null, null, null, null, null, null, null},
 736                 {null, null, null, null, null, null, null, null, null},
 737                 {null, null, null, null, null, null, null, null, null},
 738                 {null, null, null, null, null, null, null, null, null},
 739                 {null, null, null, null, null, null, null, null, null},
 740                 {null, null, null, null, null, null, null, null, null},
 741                 {null, null, null, null, null, null, null, null, null},
 742                 {null, null, null, null, null, null, null, null, null},
 743                 {null, null, null, null, null, null, null, null, null},
 744                 {null, null, null, null, null, null, null, null, null},
 745                 {null, null, null, null, null, null, null, null, null},
 746                 {null, null, null, null, null, null, null, null, null},
 747                 {null, null, null, null, null, null, null, null, null},
 748                 {null, null, null, null, null, null, null, null, null},
 749                 {null, null, null, null, null, null, null, null, null},
 750                 {null, null, null, null, null, null, null, null, null},
 751                 {null, null, null, null, null, null, null, null, null},
 752                 {null, null, null, null, null, null, null, null, null},
 753                 {null, null, null, null, null, null, null, null, null},
 754                 {null, null, null, null, null, null, null, null, null}
 755             },
 756             new String [] {
 757                 "Vegetable", "Fruit", "Planting Date", "Is frost", "Date of Frost", "Amount of seeds", "Is Indoor", "Comment", "Location"
 758             }
 759         ));
 760         jScrollPane5.setViewportView(springSearchTable);
 761 
 762         searchTableOther.setModel(new javax.swing.table.DefaultTableModel(
 763             new Object [][] {
 764                 {null, null, null, null, null, null},
 765                 {null, null, null, null, null, null},
 766                 {null, null, null, null, null, null},
 767                 {null, null, null, null, null, null},
 768                 {null, null, null, null, null, null},
 769                 {null, null, null, null, null, null},
 770                 {null, null, null, null, null, null},
 771                 {null, null, null, null, null, null},
 772                 {null, null, null, null, null, null},
 773                 {null, null, null, null, null, null},
 774                 {null, null, null, null, null, null},
 775                 {null, null, null, null, null, null},
 776                 {null, null, null, null, null, null},
 777                 {null, null, null, null, null, null},
 778                 {null, null, null, null, null, null},
 779                 {null, null, null, null, null, null},
 780                 {null, null, null, null, null, null},
 781                 {null, null, null, null, null, null},
 782                 {null, null, null, null, null, null},
 783                 {null, null, null, null, null, null},
 784                 {null, null, null, null, null, null},
 785                 {null, null, null, null, null, null},
 786                 {null, null, null, null, null, null},
 787                 {null, null, null, null, null, null},
 788                 {null, null, null, null, null, null},
 789                 {null, null, null, null, null, null},
 790                 {null, null, null, null, null, null},
 791                 {null, null, null, null, null, null},
 792                 {null, null, null, null, null, null},
 793                 {null, null, null, null, null, null},
 794                 {null, null, null, null, null, null},
 795                 {null, null, null, null, null, null},
 796                 {null, null, null, null, null, null},
 797                 {null, null, null, null, null, null},
 798                 {null, null, null, null, null, null},
 799                 {null, null, null, null, null, null},
 800                 {null, null, null, null, null, null},
 801                 {null, null, null, null, null, null},
 802                 {null, null, null, null, null, null},
 803                 {null, null, null, null, null, null},
 804                 {null, null, null, null, null, null},
 805                 {null, null, null, null, null, null},
 806                 {null, null, null, null, null, null},
 807                 {null, null, null, null, null, null},
 808                 {null, null, null, null, null, null},
 809                 {null, null, null, null, null, null},
 810                 {null, null, null, null, null, null},
 811                 {null, null, null, null, null, null},
 812                 {null, null, null, null, null, null},
 813                 {null, null, null, null, null, null}
 814             },
 815             new String [] {
 816                 "Vegetable", "Fruit", "Planting date", "Amount of Seeds", "Is indoor", "Location "
 817             }
 818         ));
 819         otherSearchTable.setViewportView(searchTableOther);
 820 
 821         springVegetableSearchCB.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Broccoli", "Zuchini", "Carrot", "Legumes", " " }));
 822 
 823         jLabel9.setText("Search:");
 824 
 825         otherSearchCB.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Beets", "Carrots", "Cauliflower", "Celery", "Potatoes", "Beans", "Cucumbre", "Eggplant", "Corn", "Sweet potatoes", "Tomatoes", "Kiwis", "Mandarines", "Oranges", "Pears", "Pommelos", "Tangerines" }));
 826 
 827         springSearchButton.setText("Search info for Spring");
 828         springSearchButton.addMouseListener(new java.awt.event.MouseAdapter() {
 829             public void mouseReleased(java.awt.event.MouseEvent evt) {
 830                 springSearchButtonMouseReleased(evt);
 831             }
 832         });
 833 
 834         jLabel11.setText("Search:");
 835 
 836         otherSearchButton.setText("Search info for Other");
 837         otherSearchButton.addMouseListener(new java.awt.event.MouseAdapter() {
 838             public void mouseReleased(java.awt.event.MouseEvent evt) {
 839                 otherSearchButtonMouseReleased(evt);
 840             }
 841         });
 842 
 843         javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
 844         jPanel5.setLayout(jPanel5Layout);
 845         jPanel5Layout.setHorizontalGroup(
 846             jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 847             .addGroup(jPanel5Layout.createSequentialGroup()
 848                 .addContainerGap()
 849                 .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 850                     .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 602, javax.swing.GroupLayout.PREFERRED_SIZE)
 851                     .addComponent(otherSearchTable, javax.swing.GroupLayout.PREFERRED_SIZE, 598, javax.swing.GroupLayout.PREFERRED_SIZE))
 852                 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
 853             .addGroup(jPanel5Layout.createSequentialGroup()
 854                 .addGap(65, 65, 65)
 855                 .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
 856                     .addComponent(jLabel11)
 857                     .addComponent(jLabel9))
 858                 .addGap(32, 32, 32)
 859                 .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 860                     .addComponent(otherSearchCB, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
 861                     .addComponent(springVegetableSearchCB, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
 862                 .addGap(124, 124, 124)
 863                 .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 864                     .addComponent(otherSearchButton)
 865                     .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
 866                         .addComponent(springSearchButton)
 867                         .addGap(32, 32, 32))))
 868         );
 869         jPanel5Layout.setVerticalGroup(
 870             jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 871             .addGroup(jPanel5Layout.createSequentialGroup()
 872                 .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 873                     .addGroup(jPanel5Layout.createSequentialGroup()
 874                         .addGap(25, 25, 25)
 875                         .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
 876                             .addComponent(jLabel9)
 877                             .addComponent(springVegetableSearchCB, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
 878                             .addComponent(springSearchButton)))
 879                     .addGroup(jPanel5Layout.createSequentialGroup()
 880                         .addGap(80, 80, 80)
 881                         .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
 882                             .addComponent(jLabel11)
 883                             .addComponent(otherSearchCB, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
 884                             .addComponent(otherSearchButton))))
 885                 .addGap(66, 66, 66)
 886                 .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 131, javax.swing.GroupLayout.PREFERRED_SIZE)
 887                 .addGap(18, 18, 18)
 888                 .addComponent(otherSearchTable, javax.swing.GroupLayout.PREFERRED_SIZE, 137, javax.swing.GroupLayout.PREFERRED_SIZE)
 889                 .addContainerGap(106, Short.MAX_VALUE))
 890         );
 891 
 892         jTabbedPane1.addTab("Search ", jPanel5);
 893 
 894         fileMenu.setMnemonic('f');
 895         fileMenu.setText("File");
 896 
 897         openSpringMI.setMnemonic('o');
 898         openSpringMI.setText("Open");
 899         openSpringMI.addMouseListener(new java.awt.event.MouseAdapter() {
 900             public void mouseReleased(java.awt.event.MouseEvent evt) {
 901                 openSpringMIMouseReleased(evt);
 902             }
 903         });
 904         openSpringMI.addActionListener(new java.awt.event.ActionListener() {
 905             public void actionPerformed(java.awt.event.ActionEvent evt) {
 906                 openSpringMIActionPerformed(evt);
 907             }
 908         });
 909         fileMenu.add(openSpringMI);
 910 
 911         saveSpringMI.setMnemonic('s');
 912         saveSpringMI.setText("SaveSpring");
 913         saveSpringMI.addMouseListener(new java.awt.event.MouseAdapter() {
 914             public void mouseReleased(java.awt.event.MouseEvent evt) {
 915                 saveSpringMIMouseReleased(evt);
 916             }
 917         });
 918         fileMenu.add(saveSpringMI);
 919 
 920         SaveOtherMI.setText("SaveOther");
 921         SaveOtherMI.addMouseListener(new java.awt.event.MouseAdapter() {
 922             public void mouseReleased(java.awt.event.MouseEvent evt) {
 923                 SaveOtherMIMouseReleased(evt);
 924             }
 925         });
 926         fileMenu.add(SaveOtherMI);
 927 
 928         saveAsMenuItem.setMnemonic('a');
 929         saveAsMenuItem.setText("Save As ...");
 930         saveAsMenuItem.setDisplayedMnemonicIndex(5);
 931         fileMenu.add(saveAsMenuItem);
 932 
 933         exitMenuItem.setMnemonic('x');
 934         exitMenuItem.setText("Exit");
 935         exitMenuItem.addActionListener(new java.awt.event.ActionListener() {
 936             public void actionPerformed(java.awt.event.ActionEvent evt) {
 937                 exitMenuItemActionPerformed(evt);
 938             }
 939         });
 940         fileMenu.add(exitMenuItem);
 941 
 942         openOtherMI.setText("OpenOther");
 943         openOtherMI.addMouseListener(new java.awt.event.MouseAdapter() {
 944             public void mouseReleased(java.awt.event.MouseEvent evt) {
 945                 openOtherMIMouseReleased(evt);
 946             }
 947         });
 948         openOtherMI.addActionListener(new java.awt.event.ActionListener() {
 949             public void actionPerformed(java.awt.event.ActionEvent evt) {
 950                 openOtherMIActionPerformed(evt);
 951             }
 952         });
 953         fileMenu.add(openOtherMI);
 954 
 955         menuBar.add(fileMenu);
 956 
 957         editMenu.setMnemonic('e');
 958         editMenu.setText("Edit");
 959 
 960         cutMenuItem.setMnemonic('t');
 961         cutMenuItem.setText("Cut");
 962         editMenu.add(cutMenuItem);
 963 
 964         copyMenuItem.setMnemonic('y');
 965         copyMenuItem.setText("Copy");
 966         editMenu.add(copyMenuItem);
 967 
 968         pasteMenuItem.setMnemonic('p');
 969         pasteMenuItem.setText("Paste");
 970         editMenu.add(pasteMenuItem);
 971 
 972         deleteMenuItem.setMnemonic('d');
 973         deleteMenuItem.setText("Delete");
 974         editMenu.add(deleteMenuItem);
 975 
 976         menuBar.add(editMenu);
 977 
 978         helpMenu.setMnemonic('h');
 979         helpMenu.setText("Help");
 980 
 981         contentsMenuItem.setMnemonic('c');
 982         contentsMenuItem.setText("Contents");
 983         helpMenu.add(contentsMenuItem);
 984 
 985         aboutMenuItem.setMnemonic('a');
 986         aboutMenuItem.setText("About");
 987         helpMenu.add(aboutMenuItem);
 988 
 989         menuBar.add(helpMenu);
 990 
 991         setJMenuBar(menuBar);
 992 
 993         javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
 994         getContentPane().setLayout(layout);
 995         layout.setHorizontalGroup(
 996             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 997             .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
 998                 .addContainerGap()
 999                 .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 646, Short.MAX_VALUE)
1000                 .addContainerGap())
1001         );
1002         layout.setVerticalGroup(
1003             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
1004             .addGroup(layout.createSequentialGroup()
1005                 .addContainerGap()
1006                 .addComponent(jTabbedPane1)
1007                 .addContainerGap())
1008         );
1009 
1010         pack();
1011     }// </editor-fold>                        
1592     // Variables declaration - do not modify                     
1593     private javax.swing.JMenuItem SaveOtherMI;
1594     private javax.swing.JComboBox SpringVegetableCB;
1595     private javax.swing.JMenuItem aboutMenuItem;
1596     private javax.swing.ButtonGroup buttonGroup1;
1597     private javax.swing.ButtonGroup buttonGroup2;
1598     private javax.swing.ButtonGroup buttonGroup3;
1599     private javax.swing.ButtonGroup buttonGroup4;
1600     private javax.swing.ButtonGroup buttonGroup5;
1601     private javax.swing.ButtonGroup buttonGroup6;
1602     private javax.swing.ButtonGroup buttonGroup7;
1603     private javax.swing.JTextField commentTF;
1604     private javax.swing.JMenuItem contentsMenuItem;
1605     private javax.swing.JMenuItem copyMenuItem;
1606     private javax.swing.JMenuItem cutMenuItem;
1607     private javax.swing.JTextField dateOfFrostTF;
1608     private javax.swing.JMenuItem deleteMenuItem;
1609     private javax.swing.JButton displayOther;
1610     private javax.swing.JButton displaySpring;
1611     private javax.swing.JMenu editMenu;
1612     private javax.swing.JTable entryTableOther;
1613     private javax.swing.JTable entryTableSpring;
1614     private javax.swing.JMenuItem exitMenuItem;
1615     private javax.swing.JMenu fileMenu;
1616     private javax.swing.JMenu helpMenu;
1617     private javax.swing.JRadioButton isFrostRB;
1618     private javax.swing.JRadioButton isNotFrostRB;
1619     private javax.swing.JButton jButton2;
1620     private javax.swing.JLabel jLabel1;
1621     private javax.swing.JLabel jLabel11;
1622     private javax.swing.JLabel jLabel13;
1623     private javax.swing.JLabel jLabel17;
1624     private javax.swing.JLabel jLabel18;
1625     private javax.swing.JLabel jLabel19;
1626     private javax.swing.JLabel jLabel2;
1627     private javax.swing.JLabel jLabel20;
1628     private javax.swing.JLabel jLabel21;
1629     private javax.swing.JLabel jLabel22;
1630     private javax.swing.JLabel jLabel23;
1631     private javax.swing.JLabel jLabel28;
1632     private javax.swing.JLabel jLabel29;
1633     private javax.swing.JLabel jLabel3;
1634     private javax.swing.JLabel jLabel34;
1635     private javax.swing.JLabel jLabel35;
1636     private javax.swing.JLabel jLabel4;
1637     private javax.swing.JLabel jLabel41;
1638     private javax.swing.JLabel jLabel5;
1639     private javax.swing.JLabel jLabel6;
1640     private javax.swing.JLabel jLabel7;
1641     private javax.swing.JLabel jLabel9;
1642     private javax.swing.JMenu jMenu1;
1643     private javax.swing.JMenu jMenu2;
1644     private javax.swing.JMenu jMenu3;
1645     private javax.swing.JMenuBar jMenuBar1;
1646     private javax.swing.JPanel jPanel1;
1647     private javax.swing.JPanel jPanel2;
1648     private javax.swing.JPanel jPanel3;
1649     private javax.swing.JPanel jPanel4;
1650     private javax.swing.JPanel jPanel5;
1651     private javax.swing.JScrollPane jScrollPane3;
1652     private javax.swing.JScrollPane jScrollPane4;
1653     private javax.swing.JScrollPane jScrollPane5;
1654     private javax.swing.JSeparator jSeparator1;
1655     private javax.swing.JSeparator jSeparator2;
1656     private javax.swing.JTabbedPane jTabbedPane1;
1657     private javax.swing.JMenuBar menuBar;
1658     private javax.swing.JMenuItem openOtherMI;
1659     private javax.swing.JMenuItem openSpringMI;
1660     private javax.swing.JTextField otherAmountYieldTF;
1661     private javax.swing.JTextField otherDateOfPlantingTF;
1662     private javax.swing.JButton otherEntryButton;
1663     private javax.swing.JComboBox otherFruitCB;
1664     private javax.swing.JRadioButton otherIsIndoorRB;
1665     private javax.swing.JRadioButton otherIsNotIndoorRB;
1666     private javax.swing.JComboBox otherLocationIndoorCB;
1667     private javax.swing.JButton otherSearchButton;
1668     private javax.swing.JComboBox otherSearchCB;
1669     private javax.swing.JScrollPane otherSearchTable;
1670     private javax.swing.JScrollPane otherSearchTable1;
1671     private javax.swing.JComboBox otherVegetableCB;
1672     private javax.swing.JMenuItem pasteMenuItem;
1673     private javax.swing.JMenuItem saveAsMenuItem;
1674     private javax.swing.JMenuItem saveSpringMI;
1675     private javax.swing.JTable searchTableOther;
1676     private javax.swing.JTable searchTableOther1;
1677     private javax.swing.JTextField springAmountOfYieldTF;
1678     private javax.swing.JTextField springDateOfPlantingTF;
1679     private javax.swing.JButton springEntryButton;
1680     private javax.swing.JComboBox springFruitCB;
1681     private javax.swing.JRadioButton springIsIndoorRB;
1682     private javax.swing.JRadioButton springIsNotIndoorRB;
1683     private javax.swing.JComboBox springLocationIndoorCB;
1684     private javax.swing.JButton springSearchButton;
1685     private javax.swing.JTable springSearchTable;
1686     private javax.swing.JComboBox springVegetableSearchCB;
1687     // End of variables declaration                   
1688 
1689 }
1690