/Users/johnr/Desktop/IA_14_-_Stage_P_Upload_all_2021-04-08/CS IA Shoe Reselling Aryan April 6th /src/MainShoesGUI1.java
   1 
   2 
   3 import java.awt.Color;
   4 import java.io.IOException;
   5 import java.util.LinkedList;
   6 import java.util.logging.Level;
   7 import java.util.logging.Logger;
   8 import javax.swing.JOptionPane;
   9 import javax.swing.JTable;
  10 import javax.swing.SpinnerModel;
  11 import javax.swing.SpinnerNumberModel;
  12 import javax.swing.table.DefaultTableModel;
  13 
  14 /*
  15  * To change this license header, choose License Headers in Project Properties.
  16  * To change this template file, choose Tools | Templates
  17  * and open the template in the editor.
  18  */
  19 
  20 
  21 /**
  22  *
  23  * @author 19808
  24  *  Extensibility List:
  25  * - Edit and correct the sorting and searching for the transaction table for it to be appropriate
  26  * - Utilize the other boolean attributes for the Children's and Women's shoes
  27  * - Enhance the visual representation of the data using pie charts and other graphs to illustrate the most profitable shoes 
  28  * in each category of its attributes
  29  * - Add clearer and more instinctual operations for the process
  30  * - Add a more composite format of displaying the profitability and benefit
  31  */
  32 public class MainShoesGUI1 extends javax.swing.JFrame {
  33 
  34     /**
  35      * Creates new form NewApplication
  36      */
  37     private FileManager fileManager = new FileManager();//Reads and writes data to either save or retreat from the hard drive
  38     LinkedList <Shoes> shoesStored;//A dynamic list of all the shoes that have been bought but not sold (inventory)
  39     LinkedList <Shoes> shoesSold; //A dynamic list of all the shoes that have been sold (transactions)
  40     LinkedList <Shoes> shoesTemp = new LinkedList<Shoes>();//Used when displaying search results and in the process of moving shoes
  41 
  42     
  43     SearchinNSortn ss = new SearchinNSortn();
  44     
  45     int counter = 0;
  46     
  47     public MainShoesGUI1() {
  48        initComponents();
  49     }
  50     
  51     
  52     /**
  53      * This method is called from within the constructor to initialize the form.
  54      * WARNING: Do NOT modify this code. The content of this method is always
  55      * regenerated by the Form Editor.
  56      */
  


Netbeans auto-generated GUI code pasted at end of this document.




 774     //Terminates all
 775     private void exitMenuItemActionPerformed(java.awt.event.ActionEvent evt) {                                             
 776         System.exit(0);
 777     }                                            
 778     
 779     //To search through the entire transaction table, to retrieve and display the searched shoe
 780     private void SearchSoldActionPerformed(java.awt.event.ActionEvent evt) {                                           
 781 
 782 
 783         resetTableInventory();
 784         switch(searchForComboBox.getSelectedItem().toString())
 785         {
 786             case "Name":
 787 
 788             shoesTemp = ss.NameSearch(shoesSold, searchInputField.getText());
 789             System.out.println(shoesTemp.size());
 790             for(int i = 0; i < shoesSold.size(); i++)
 791             {
 792                 if(i >= shoesTemp.size())
 793                 {
 794                     removeTableValueSold(i);
 795                 }
 796                 else
 797                 {
 798                     try {
 799                         setTableValueSold(shoesTemp.get(i), i);
 800                     } catch (Exception ex) {
 801                         Logger.getLogger(MainShoesGUI1.class.getName()).log(Level.SEVERE, null, ex);
 802                     }
 803                 }
 804 
 805             }
 806 
 807             break;
 808 
 809             case "Brand":
 810             shoesTemp = ss.BrandSearch(shoesSold, searchInputField.getText());
 811 
 812             for(int i = 0; i < shoesSold.size(); i++)
 813             {
 814                 if(i >= shoesTemp.size())
 815                 {
 816                     removeTableValueSold(i);
 817                 }
 818                 else
 819                 {
 820                     try {
 821                         setTableValueSold(shoesTemp.get(i), i);
 822                     } catch (Exception ex) {
 823                         Logger.getLogger(MainShoesGUI1.class.getName()).log(Level.SEVERE, null, ex);
 824                     }
 825                 }
 826             }
 827 
 828             break;
 829 
 830             case "Size"  :
 831             shoesTemp = ss.SizeSearch(shoesSold, Double.parseDouble(searchInputField.getText()));
 832 
 833             for(int i = 0; i < shoesSold.size(); i++)
 834             {
 835                 if(i >= shoesTemp.size())
 836                 {
 837                     removeTableValueSold(i);
 838                 }
 839                 else
 840                 {
 841                     try {
 842                         setTableValueSold(shoesTemp.get(i), i);
 843                     } catch (Exception ex) {
 844                         Logger.getLogger(MainShoesGUI1.class.getName()).log(Level.SEVERE, null, ex);
 845                     }
 846                 }
 847             }
 848 
 849             break;
 850 
 851             case "Collaboration":
 852             shoesTemp = ss.CollaborationSearch(shoesSold, searchInputField.getText());
 853 
 854             for(int i = 0; i < shoesSold.size(); i++)
 855             {
 856                 if(i >= shoesTemp.size())
 857                 {
 858                     removeTableValueSold(i);
 859                 }
 860                 else
 861                 {
 862                     try {
 863                         setTableValueSold(shoesTemp.get(i), i);
 864                     } catch (Exception ex) {
 865                         Logger.getLogger(MainShoesGUI1.class.getName()).log(Level.SEVERE, null, ex);
 866                     }
 867                 }
 868             }
 869             break;
 870 
 871         }
 872     }                                          
 873 
 874     //Sorts through the LinkedList shoesSold of all the sold shoes, and sorts them in order according to the users desires
 875     private void transactionTableRefreshButtonActionPerformed(java.awt.event.ActionEvent evt) {                                                              
 876 
 877         //transaction sorting
 878       try {
 879         switch(sortByTransactionComboBox.getSelectedItem().toString()){
 880             case "Name":
 881             ss.AlphabetSortName(shoesSold);
 882 
 883             for(int i = 0; i < shoesSold.size(); i++)
 884             {
 885                 setTableValueSold(shoesSold.get(i), i);
 886             }
 887 
 888             break;
 889 
 890             case "Brand":
 891             ss.AlphabetSortBrand(shoesSold);
 892 
 893             for(int i = 0; i < shoesSold.size(); i++)
 894             {
 895                 setTableValueSold(shoesSold.get(i), i);
 896             }
 897 
 898             break;
 899 
 900             case "Size"  :
 901             ss.NumSortSize(shoesSold);
 902 
 903             for(int i = 0; i < shoesSold.size(); i++)
 904             {
 905                 setTableValueSold(shoesSold.get(i), i);
 906             }
 907 
 908             break;
 909 
 910             case "Collaboration":
 911             ss.AlphabetSortCollaboration(shoesSold);
 912 
 913             for(int i = 0; i < shoesSold.size(); i++)
 914             {
 915                 setTableValueSold(shoesSold.get(i), i);
 916             }
 917 
 918             break;
 919 
 920             case "Profit":
 921 
 922             ss.ProfitSort(shoesSold);
 923 
 924             for(int i = 0; i < shoesSold.size(); i++)
 925             {
 926                 setTableValueSold(shoesSold.get(i), i);
 927             }
 928 
 929             break;
 930 
 931             case "Loss":
 932 
 933             ss.ProfitSort(shoesSold);
 934 
 935             for(int i = 0; i < shoesSold.size(); i++)
 936             {
 937                 setTableValueSold(shoesSold.get(i), shoesSold.size() - 1 - i);
 938             }
 939 
 940             break;
 941         }
 942       } catch (Exception ignored) {}
 943     }                                                             
 944 
 945     private void searchForComboBoxActionPerformed(java.awt.event.ActionEvent evt) {                                                  
 946         // TODO add your handling code here:
 947         
 948     }                                                 
 949 
 950     private void sellActionPerformed(java.awt.event.ActionEvent evt) {                                     
 951 
 952         
 953     }                                    
 954 
 955     private void soldDayActionPerformed(java.awt.event.ActionEvent evt) {                                        
 956 
 957     }                                       
 958 
 959     //Searches through the LinkedList shoesStored, to retrieve the the object shoe that the user desires to find
 960     private void inventorySearchButtonActionPerformed(java.awt.event.ActionEvent evt) {                                                      
 961         // TODO add your handling code here:
 962 
 963         resetTableInventory();
 964         try {
 965             switch(inventorySearchByComboBox.getSelectedItem().toString())
 966             {
 967                 case "Name":
 968 
 969                 shoesTemp = ss.NameSearch(shoesStored, inventorySearchField.getText());
 970                 System.out.println(shoesTemp.size());
 971                 for(int i = 0; i < shoesStored.size(); i++)
 972                 {
 973                     if(i >= shoesTemp.size())
 974                     {
 975                         removeTableValueInventory(i);
 976                     }
 977                     else
 978                     {
 979                         setTableValueInventory(shoesTemp.get(i), i);
 980                     }
 981 
 982                 }
 983 
 984                 break;
 985 
 986                 case "Brand":
 987                 shoesTemp = ss.BrandSearch(shoesStored, inventorySearchField.getText());
 988 
 989                 for(int i = 0; i < shoesStored.size(); i++)
 990                 {
 991                     if(i >= shoesTemp.size())
 992                     {
 993                         removeTableValueInventory(i);
 994                     }
 995                     else
 996                     {
 997                         setTableValueInventory(shoesTemp.get(i), i);
 998                     }
 999                 }
1000 
1001                 break;
1002 
1003                 case "Size"  :
1004                 shoesTemp = ss.SizeSearch(shoesStored, Double.parseDouble(inventorySearchField.getText()));
1005 
1006                 for(int i = 0; i < shoesStored.size(); i++)
1007                 {
1008                     if(i >= shoesTemp.size())
1009                     {
1010                         removeTableValueInventory(i);
1011                     }
1012                     else
1013                     {
1014                         setTableValueInventory(shoesTemp.get(i), i);
1015                     }
1016                 }
1017 
1018                 break;
1019 
1020                 case "Collaboration":
1021                 shoesTemp = ss.CollaborationSearch(shoesStored, inventorySearchField.getText());
1022 
1023                 for(int i = 0; i < shoesStored.size(); i++)
1024                 {
1025                     if(i >= shoesTemp.size())
1026                     {
1027                         removeTableValueInventory(i);
1028                     }
1029                     else
1030                     {
1031                         setTableValueInventory(shoesTemp.get(i), i);
1032                     }
1033                 }
1034 
1035                 break;
1036             }
1037         } catch(Exception ignored) {}
1038     }                                                     
1039 
1040     //Sorts through the LinkedList shoesStored of all the sold shoes, and sorts them in order according to the users desires
1041     private void inventoryRefreshButtonActionPerformed(java.awt.event.ActionEvent evt) {                                                       
1042 
1043         resetTableInventory();
1044         try {
1045             switch(sortByInventoryComboBox.getSelectedItem().toString())
1046             {
1047                 case "Name":
1048                 ss.AlphabetSortName(shoesStored);
1049 
1050                 for(int i = 0; i < shoesStored.size(); i++)
1051                 {
1052                     setTableValueInventory(shoesStored.get(i), i);
1053                 }
1054 
1055                 break;
1056 
1057                 case "Brand":
1058                 ss.AlphabetSortBrand(shoesStored);
1059 
1060                 for(int i = 0; i < shoesStored.size(); i++)
1061                 {
1062                     setTableValueInventory(shoesStored.get(i), i);
1063                 }
1064 
1065                 break;
1066 
1067                 case "Size"  :
1068                 ss.NumSortSize(shoesStored);
1069 
1070                 for(int i = 0; i < shoesStored.size(); i++)
1071                 {
1072                     setTableValueInventory(shoesStored.get(i), i);
1073                 }
1074 
1075                 break;
1076 
1077                 case "Collaboration":
1078                 ss.AlphabetSortCollaboration(shoesStored);
1079 
1080                 for(int i = 0; i < shoesStored.size(); i++)
1081                 {
1082                     setTableValueInventory(shoesStored.get(i), i);
1083                 }
1084 
1085                 break;
1086             }
1087         } catch(Exception ignored) {}
1088     }                                                      
1089 
1090     private void inventorySearchByComboBoxActionPerformed(java.awt.event.ActionEvent evt) {                                                          
1091 
1092     }                                                         
1093 
1094     private void InventoryTableMouseClicked(java.awt.event.MouseEvent evt) {                                            
1095 
1096     }                                           
1097 
1098     //Exception/Error handling to ensure the user has inputted some form of text or data in the necessary text fields or other input methods
1099     private boolean fieldsNotBlank() {
1100         boolean a = boughtShoeNameTF.getText().isEmpty();
1101         boolean b = boughtShoeBrandTF.getText().isEmpty();
1102         boolean c = boughtShoeCollaborationTF.getText().isEmpty();
1103         boolean d = dateBoughtDayTF.getText().equals("DD");
1104         boolean e = dateBoughtMonthTF.getText().equals("MM");
1105         boolean f = dateBoughtYearTF.getText().equals("YYYY");
1106         boolean g = boughtShoeGenderComboBox.getSelectedIndex() == 0;
1107         boolean h = boughtShoePriceSpinner.getValue().toString().equals("0");
1108         boolean i = (double)boughtShoeSizeSpinner.getValue() == 0;
1109         return !(a||b||c||d||e||f||g||h||i);
1110     }
1111     
1112     //Ensures the inputted data is error handled, and adds the shoe to the inventory directory, and refresh the table for the LinkedList shoesStored
1113     private void boughtShoeConfirmationButtonMouseReleased(java.awt.event.MouseEvent evt) {                                                           
1114         // TODO add your handling code here:
1115 
1116         if(fieldsNotBlank() && 0 < Integer.parseInt(dateBoughtDayTF.getText()) && 32 > Integer.parseInt(dateBoughtDayTF.getText())
1117                 && 0 < Integer.parseInt(dateBoughtMonthTF.getText()) && 13 > Integer.parseInt(dateBoughtMonthTF.getText()))
1118         {
1119             double d = Double.parseDouble(boughtShoeSizeSpinner.getValue().toString());
1120 
1121             Shoes newShoe = new Shoes(boughtShoeNameTF.getText(), d, (int)boughtShoePriceSpinner.getValue(), 0, Integer.parseInt(dateBoughtDayTF.getText()), Integer.parseInt(dateBoughtMonthTF.getText()), Integer.parseInt(dateBoughtYearTF.getText()), "unknown", 00, 00, 00, boughtShoeCollaborationTF.getText(), boughtShoeBrandTF.getText(), 0, boughtShoeGenderComboBox.getSelectedItem().toString());
1122             
1123             try {
1124                 fileManager.addToShoeArray("inventory", newShoe);
1125                 
1126             } catch (IOException ex) {}
1127             boughtShoeNameTF.setText("");
1128             boughtShoeBrandTF.setText("");
1129             boughtShoeCollaborationTF.setText("");
1130             dateBoughtDayTF.setText("DD");
1131             dateBoughtMonthTF.setText("MM");
1132             dateBoughtYearTF.setText("YYYY");
1133             boughtShoeGenderComboBox.setSelectedIndex(0);
1134             boughtShoePriceSpinner.setValue(0);
1135             boughtShoeSizeSpinner.setValue(0);
1136             
1137             try {
1138                 refreshTables();
1139             } catch (Exception ex) {
1140                 Logger.getLogger(MainShoesGUI1.class.getName()).log(Level.SEVERE, null, ex);
1141             }
1142        
1143         } else {
1144             JOptionPane.showMessageDialog(null, "Do not leave any fields blank, or input values out of calendar boundaries!");
1145         }
1146         
1147     }                                                          
1148 
1149     private void boughtShoeGenderComboBoxActionPerformed(java.awt.event.ActionEvent evt) {                                                         
1150         // TODO add your handling code here:
1151     }                                                        
1152 
1153     private void transactionHistoryButtonActionPerformed(java.awt.event.ActionEvent evt) {                                                         
1154         // TODO add your handling code here:
1155     }                                                        
1156 
1157     //Ensures the inputted data is error handled, removes the shoe from the inventory directory 
1158     //and adds the shoe to the transaction directory, and refresh the table for the LinkedList shoesSold
1159     private void sellMouseReleased(java.awt.event.MouseEvent evt) {                                   
1160         // TODO add your handling code here:
1161         if(InventoryTable.getSelectedRow() >= 0 && 0 < Integer.parseInt(soldDay.getText()) && 32 > Integer.parseInt(soldDay.getText())
1162                 && 0 < Integer.parseInt(soldMonth.getText()) && 13 > Integer.parseInt(soldMonth.getText()))
1163         {
1164 
1165             int day = Integer.parseInt(soldDay.getText());
1166             int month = Integer.parseInt(soldMonth.getText());
1167             int year = Integer.parseInt(soldYear.getText());
1168 
1169             String soldDate = day + "/" + month + "/" + year;
1170             int index = InventoryTable.getSelectedRow();
1171             int sellingPrice = Integer.parseInt(FinalSellingPrice.getValue().toString());
1172             
1173            
1174             try {
1175                 Shoes temp = fileManager.getShoe("inventory", index);
1176                 temp.setShoeDateSoldDay(day);
1177                 temp.setShoeDateSoldMonth(month);
1178                 temp.setShoeDateSoldYear(year);
1179                 temp.setProfitability(sellingPrice-temp.getBuyingPrice());
1180                 
1181                 fileManager.removeShoe("inventory", InventoryTable.getSelectedRow());
1182                 fileManager.addToShoeArray("inventory", temp);
1183                 
1184                 int inventorySize = fileManager.arrayCount("inventory");
1185                 fileManager.moveToTransactions(fileManager.getShoe("inventory", inventorySize-1), inventorySize-1);
1186                 refreshTables();
1187             } catch (Exception ex) {
1188                 Logger.getLogger(MainShoesGUI1.class.getName()).log(Level.SEVERE, null, ex);
1189             }
1190 
1191  
1192             InventoryTable.clearSelection();
1193         } else {
1194             JOptionPane.showMessageDialog(null, "Do not leave any fields blank, or input values out of calendar boundaries!");
1195         }
1196         
1197         soldDay.setText("DD");
1198         soldMonth.setText("MM");
1199         soldYear.setText("YYYY");     
1200         FinalSellingPrice.setValue(0);
1201         
1202     }                                  
1203     
1204     //Goes from home panel to the Buying panel
1205     private void buyButtonMouseReleased(java.awt.event.MouseEvent evt) {                                        
1206         // TODO add your handling code here:
1207         Main.setSelectedIndex(1);
1208     }                                       
1209 
1210     //Goes from home panel to the Inventory panel
1211     private void inventoryCheckButtonMouseReleased(java.awt.event.MouseEvent evt) {                                                   
1212         // TODO add your handling code here:
1213         Main.setSelectedIndex(2);
1214     }                                                  
1215 
1216     //Goes from home panel to the Transactions panel
1217     private void transactionHistoryButtonMouseReleased(java.awt.event.MouseEvent evt) {                                                       
1218         // TODO add your handling code here:
1219         Main.setSelectedIndex(3);
1220     }                                                      
1221 
1222     //Clears the dateBoughtDayTF text field
1223     private void dateBoughtDayTFMouseReleased(java.awt.event.MouseEvent evt) {                                              
1224         if(dateBoughtDayTF.getText().equals("DD")) {
1225             dateBoughtDayTF.setText("");
1226         }
1227     }                                             
1228 
1229     //Clears the dateBoughtMonthTF text field
1230     private void dateBoughtMonthTFMouseReleased(java.awt.event.MouseEvent evt) {                                                
1231         // TODO add your handling code here:
1232         if(dateBoughtMonthTF.getText().equals("MM")) {
1233             dateBoughtMonthTF.setText("");
1234         }
1235     }                                               
1236 
1237     //Clears the dateBoughtYearTF text field
1238     private void dateBoughtYearTFMouseReleased(java.awt.event.MouseEvent evt) {                                               
1239         // TODO add your handling code here:
1240         if(dateBoughtYearTF.getText().equals("YYYY")) {
1241             dateBoughtYearTF.setText("");
1242         }
1243     }                                              
1244 
1245     //Clears the soldDay text field
1246     private void soldDayMouseReleased(java.awt.event.MouseEvent evt) {                                      
1247         // TODO add your handling code here:
1248         if(soldDay.getText().equals("DD")) {
1249             soldDay.setText("");
1250         }
1251     }                                     
1252 
1253     //Clears the soldMonth text field
1254     private void soldMonthMouseReleased(java.awt.event.MouseEvent evt) {                                        
1255         // TODO add your handling code here:
1256         if(soldMonth.getText().equals("MM")) {
1257             soldMonth.setText("");
1258         }
1259     }                                       
1260 
1261     //Clears the soldYear text field
1262     private void soldYearMouseReleased(java.awt.event.MouseEvent evt) {                                       
1263         // TODO add your handling code here:
1264         if(soldYear.getText().equals("YYYY")) {
1265             soldYear.setText("");
1266         }
1267     }                                      
1268 
1269     //Get the specific information for the shoe object for each attribute for the Inventory table
1270     private void AddTableValueInventory(Shoes shoe) //new item 
1271     {
1272         InventoryTable.setValueAt(shoe.getName(), shoesStored.size() - 1, 0);
1273         InventoryTable.setValueAt(shoe.getBrand(), shoesStored.size()- 1, 1);
1274         InventoryTable.setValueAt(shoe.getSize(), shoesStored.size()- 1, 2);
1275         InventoryTable.setValueAt(shoe.getCollaboration(), shoesStored.size()- 1, 3);
1276         InventoryTable.setValueAt(shoe.getGender(), shoesStored.size()- 1, 4);
1277         InventoryTable.setValueAt(shoe.getBoughtDate(), shoesStored.size()- 1, 5);
1278     }
1279     
1280     //Get the specific information for the shoe object for each attribute for the Transactions table
1281     private void AddTableValueSold(Shoes shoe, String soldDate) throws Exception//new item 
1282     {
1283         TransactionTable.setValueAt(shoe.getName(), shoesSold.size() - 1, 0);
1284         TransactionTable.setValueAt(shoe.getBrand(), shoesSold.size() - 1, 1);
1285         TransactionTable.setValueAt(shoe.getSize(), shoesSold.size() - 1, 2);
1286         TransactionTable.setValueAt(shoe.getCollaboration(), shoesSold.size() - 1, 3);
1287         TransactionTable.setValueAt(shoe.getGender(), shoesSold.size() - 1, 4);
1288         TransactionTable.setValueAt(shoe.getBoughtDate(), shoesSold.size() - 1, 5);
1289         
1290         TransactionTable.setValueAt(soldDate, shoesSold.size() - 1, 6);
1291         TransactionTable.setValueAt(shoe.getSellingPrice() - shoe.getBuyingPrice(), shoesSold.size() - 1, 7);
1292     }
1293     
1294     //Set the specific information for the shoe object for each attribute for the Inventory table
1295     private void setTableValueInventory(Shoes shoe, int i) throws Exception//set specific value
1296     {
1297         InventoryTable.setValueAt(shoe.getName(), i, 0);
1298         InventoryTable.setValueAt(shoe.getBrand(), i, 1);
1299         InventoryTable.setValueAt(shoe.getSize(), i, 2);
1300         InventoryTable.setValueAt(shoe.getCollaboration(), i, 3);
1301         InventoryTable.setValueAt(shoe.getGender(), i, 4);
1302         InventoryTable.setValueAt(shoe.getBoughtDate(), i, 5);
1303     }
1304     
1305     //Get the specific information for the shoe object for each attribute for the Transactions table
1306     private void setTableValueSold(Shoes shoe, int i) throws Exception
1307     {
1308         TransactionTable.setValueAt(shoe.getName(), i, 0);
1309         TransactionTable.setValueAt(shoe.getBrand(), i, 1);
1310         TransactionTable.setValueAt(shoe.getSize(), i, 2);
1311         TransactionTable.setValueAt(shoe.getCollaboration(), i, 3);
1312         TransactionTable.setValueAt(shoe.getGender(), i, 4);
1313         TransactionTable.setValueAt(shoe.getBoughtDate(), i, 5);
1314         
1315         String sold = shoe.getShoeDateSoldDay() + "/" + shoe.getShoeDateSoldMonth() + "/" + shoe.getShoeDateSoldYear();
1316         TransactionTable.setValueAt(sold, i, 6);
1317         TransactionTable.setValueAt(shoe.getSellingPrice() - shoe.getBuyingPrice(), i, 7);
1318         
1319     }
1320     
1321     //Remove a shoe object from the Inventory table
1322     private void removeTableValueInventory(int i)
1323     {
1324         InventoryTable.setValueAt("", i, 0);
1325         InventoryTable.setValueAt("", i, 1);
1326         InventoryTable.setValueAt(null, i, 2);
1327         InventoryTable.setValueAt("", i, 3);
1328         InventoryTable.setValueAt("", i, 4);
1329         InventoryTable.setValueAt("", i, 5);
1330     }
1331     
1332     //Remove a shoe object from the Transactions table
1333     private void removeTableValueSold(int i)
1334     {
1335         TransactionTable.setValueAt("", i, 0);
1336         TransactionTable.setValueAt("", i, 1);
1337         TransactionTable.setValueAt(null, i, 2);
1338         TransactionTable.setValueAt("", i, 3);
1339         TransactionTable.setValueAt("", i, 4);
1340         TransactionTable.setValueAt("", i, 5);
1341         
1342         TransactionTable.setValueAt("", i, 6);
1343         TransactionTable.setValueAt(null, i, 7);
1344     }
1345     
1346     //Clears the entire Inventory Table
1347     private void resetTableInventory()
1348     {
1349          
1350         for(int i = 0; i < shoesStored.size(); i++) //makes a clean sweep to update the table 
1351         {
1352             InventoryTable.setValueAt(shoesStored.get(i).getName(), i, 0);
1353             InventoryTable.setValueAt(shoesStored.get(i).getBrand(), i, 1);
1354             InventoryTable.setValueAt(shoesStored.get(i).getSize(), i, 2);
1355             InventoryTable.setValueAt(shoesStored.get(i).getCollaboration(), i, 3);
1356             InventoryTable.setValueAt(shoesStored.get(i).getGender(), i, 4);
1357             InventoryTable.setValueAt(shoesStored.get(i).getBoughtDate(), i, 5);
1358            
1359         }
1360         
1361         
1362     }
1363     
1364     
1365     /**
1366      * @param args the command line arguments
1367      */
1368     
1369     private static MainShoesGUI1 main = new MainShoesGUI1();
1370     public static void main(String args[]) {
1371         /* Set the Nimbus look and feel */
1372         //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
1373         /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
1374          * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
1375          */
1376 //        try {
1377 //            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
1378 //                if ("Nimbus".equals(info.getName())) {
1379 //                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
1380 //                    break;
1381 //                }
1382 //            }
1383 //        } catch (ClassNotFoundException ex) {
1384 //            java.util.logging.Logger.getLogger(NewApplication.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
1385 //        } catch (InstantiationException ex) {
1386 //            java.util.logging.Logger.getLogger(NewApplication.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
1387 //        } catch (IllegalAccessException ex) {
1388 //            java.util.logging.Logger.getLogger(NewApplication.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
1389 //        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
1390 //            java.util.logging.Logger.getLogger(NewApplication.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
1391 //        }
1392         //</editor-fold>
1393 
1394         /* Create and display the form */
1395         java.awt.EventQueue.invokeLater(new Runnable() {
1396             public void run() {
1397                 main.setVisible(true);
1398                 try {
1399                     main.refreshTables();
1400                 } catch (Exception ex) {
1401                     Logger.getLogger(MainShoesGUI1.class.getName()).log(Level.SEVERE, null, ex);
1402                 }
1403             }
1404         });
1405     }
1406     //Refreshes the LinkedList and Table for Inventory (shoesStored) or Transactions (shoesSold)
1407     private void refreshTables() throws Exception {
1408         DefaultTableModel model1 = (DefaultTableModel)InventoryTable.getModel();//New model for saving the bought shoes
1409         clearTable(InventoryTable);
1410         shoesStored = new LinkedList<Shoes>();//LinkedList for the shoes that are bought but not sold
1411         for(int i = 0; i < fileManager.arrayCount("inventory"); i++) {
1412             Shoes tempShoe = fileManager.getShoe("inventory", i);
1413             model1.addRow(new Object[]{tempShoe.getName(), tempShoe.getBrand(), tempShoe.getSize(), tempShoe.getCollaboration(), tempShoe.getGender(), tempShoe.getBoughtDate()});
1414             shoesStored.add(tempShoe);//Add the shoe to the Inventory table
1415         }
1416         
1417         DefaultTableModel model2 = (DefaultTableModel)TransactionTable.getModel();//New model for saving the sold shoes
1418         clearTable(TransactionTable);
1419         shoesSold = new LinkedList<Shoes>();//LinkedList for the shoes that are sold
1420         for(int i = 0; i < fileManager.arrayCount("transaction"); i++) {
1421             Shoes tempShoe = fileManager.getShoe("transaction", i);
1422             String soldDate = tempShoe.getShoeDateSoldDay() + "/" + tempShoe.getShoeDateSoldMonth() + "/" + tempShoe.getShoeDateSoldYear();
1423             model2.addRow(new Object[]{tempShoe.getName(), tempShoe.getBrand(), tempShoe.getSize(), tempShoe.getCollaboration(), tempShoe.getGender(), tempShoe.getBoughtDate(), soldDate, tempShoe.getProfitability()});
1424             shoesSold.add(tempShoe);//Add the shoe to the Transaction table
1425         }
1426     }
1427     
1428     //Remove everything from the desired table
1429     public void clearTable(JTable table) {
1430         DefaultTableModel model = (DefaultTableModel) table.getModel();
1431         int n = model.getRowCount();
1432         for (int i = 0; i < n; i++) {
1433             model.removeRow(model.getRowCount() - 1);
1434        }
1435     }
1436     
1437     SpinnerModel model; 






Autogenerated Netbeans GUI Code Below:



57     @SuppressWarnings("unchecked")
  58     // <editor-fold defaultstate="collapsed" desc="Generated Code">                          
  59     private void initComponents() {
  60 
  61         jFrame1 = new javax.swing.JFrame();
  62         Main = new javax.swing.JTabbedPane();
  63         Home = new javax.swing.JPanel();
  64         buyButton = new javax.swing.JButton();
  65         inventoryCheckButton = new javax.swing.JButton();
  66         transactionHistoryButton = new javax.swing.JButton();
  67         Welcome = new javax.swing.JLabel();
  68         Buying = new javax.swing.JPanel();
  69         boughtShoeNameTF = new javax.swing.JTextField();
  70         boughtShoeNameLabel = new javax.swing.JLabel();
  71         boughtShoeGenderLabel = new javax.swing.JLabel();
  72         boughtShoeSizeLabel = new javax.swing.JLabel();
  73         dateShoeBoughtLabel = new javax.swing.JLabel();
  74         buyingPriceLabel = new javax.swing.JLabel();
  75         boughtShoeSizeSpinner = new javax.swing.JSpinner();
  76         boughtShoePriceSpinner = new javax.swing.JSpinner();
  77         boughtShoeGenderComboBox = new javax.swing.JComboBox<>();
  78         dateBoughtDayTF = new javax.swing.JTextField();
  79         dateBoughtMonthTF = new javax.swing.JTextField();
  80         dateBoughtYearTF = new javax.swing.JTextField();
  81         boughtDateSeparator = new javax.swing.JLabel();
  82         boughtDateSeparator2 = new javax.swing.JLabel();
  83         boughtShoeBrandLabel = new javax.swing.JLabel();
  84         boughtShoeBrandTF = new javax.swing.JTextField();
  85         boughtShoeCollaborationLabel = new javax.swing.JLabel();
  86         boughtShoeCollaborationTF = new javax.swing.JTextField();
  87         boughtShoeConfirmationButton = new javax.swing.JButton();
  88         Inventory = new javax.swing.JPanel();
  89         InventoryPage = new javax.swing.JScrollPane();
  90         InventoryTable = new javax.swing.JTable();
  91         sortByInventoryComboBox = new javax.swing.JComboBox<>();
  92         sortByLabelforInventory = new javax.swing.JLabel();
  93         searchByLabelForInventory = new javax.swing.JLabel();
  94         inventorySearchByComboBox = new javax.swing.JComboBox<>();
  95         inventoryRefreshButton = new javax.swing.JButton();
  96         inventorySearchField = new javax.swing.JTextField();
  97         inventorySearchResultLabel = new javax.swing.JLabel();
  98         jLabel4 = new javax.swing.JLabel();
  99         inventorySearchResult = new javax.swing.JLabel();
 100         inventorySearchButton = new javax.swing.JButton();
 101         soldDay = new javax.swing.JTextField();
 102         soldYear = new javax.swing.JTextField();
 103         soldMonth = new javax.swing.JTextField();
 104         sell = new javax.swing.JButton();
 105         FinalSellingPrice = new javax.swing.JSpinner();
 106         searchByLabelForInventory1 = new javax.swing.JLabel();
 107         SalesHistory = new javax.swing.JPanel();
 108         searchLargetLabel = new javax.swing.JLabel();
 109         searchForComboBox = new javax.swing.JComboBox<>();
 110         transactionTableRefreshButton = new javax.swing.JButton();
 111         InventoryPage1 = new javax.swing.JScrollPane();
 112         TransactionTable = new javax.swing.JTable();
 113         searchInputField = new javax.swing.JTextField();
 114         sortByTransactionComboBox = new javax.swing.JComboBox<>();
 115         sortByTransactionLabel = new javax.swing.JLabel();
 116         searchForLabel = new javax.swing.JLabel();
 117         SearchSold = new javax.swing.JButton();
 118         menuBar = new javax.swing.JMenuBar();
 119         fileMenu = new javax.swing.JMenu();
 120         openMenuItem = new javax.swing.JMenuItem();
 121         saveMenuItem = new javax.swing.JMenuItem();
 122         saveAsMenuItem = new javax.swing.JMenuItem();
 123         exitMenuItem = new javax.swing.JMenuItem();
 124         editMenu = new javax.swing.JMenu();
 125         cutMenuItem = new javax.swing.JMenuItem();
 126         copyMenuItem = new javax.swing.JMenuItem();
 127         pasteMenuItem = new javax.swing.JMenuItem();
 128         deleteMenuItem = new javax.swing.JMenuItem();
 129         helpMenu = new javax.swing.JMenu();
 130         contentsMenuItem = new javax.swing.JMenuItem();
 131         aboutMenuItem = new javax.swing.JMenuItem();
 132 
 133         javax.swing.GroupLayout jFrame1Layout = new javax.swing.GroupLayout(jFrame1.getContentPane());
 134         jFrame1.getContentPane().setLayout(jFrame1Layout);
 135         jFrame1Layout.setHorizontalGroup(
 136             jFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 137             .addGap(0, 400, Short.MAX_VALUE)
 138         );
 139         jFrame1Layout.setVerticalGroup(
 140             jFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 141             .addGap(0, 300, Short.MAX_VALUE)
 142         );
 143 
 144         setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
 145 
 146         buyButton.setFont(new java.awt.Font("Copperplate", 1, 18)); // NOI18N
 147         buyButton.setText("Buy");
 148         buyButton.addMouseListener(new java.awt.event.MouseAdapter() {
 149             public void mouseReleased(java.awt.event.MouseEvent evt) {
 150                 buyButtonMouseReleased(evt);
 151             }
 152         });
 153 
 154         inventoryCheckButton.setFont(new java.awt.Font("Copperplate", 1, 18)); // NOI18N
 155         inventoryCheckButton.setText("Inventory Check");
 156         inventoryCheckButton.addMouseListener(new java.awt.event.MouseAdapter() {
 157             public void mouseReleased(java.awt.event.MouseEvent evt) {
 158                 inventoryCheckButtonMouseReleased(evt);
 159             }
 160         });
 161 
 162         transactionHistoryButton.setFont(new java.awt.Font("Copperplate", 1, 18)); // NOI18N
 163         transactionHistoryButton.setText("Transaction History");
 164         transactionHistoryButton.addMouseListener(new java.awt.event.MouseAdapter() {
 165             public void mouseReleased(java.awt.event.MouseEvent evt) {
 166                 transactionHistoryButtonMouseReleased(evt);
 167             }
 168         });
 169         transactionHistoryButton.addActionListener(new java.awt.event.ActionListener() {
 170             public void actionPerformed(java.awt.event.ActionEvent evt) {
 171                 transactionHistoryButtonActionPerformed(evt);
 172             }
 173         });
 174 
 175         Welcome.setFont(new java.awt.Font("League Spartan", 1, 24)); // NOI18N
 176         Welcome.setText("Welcome! What do we want to do today?");
 177 
 178         javax.swing.GroupLayout HomeLayout = new javax.swing.GroupLayout(Home);
 179         Home.setLayout(HomeLayout);
 180         HomeLayout.setHorizontalGroup(
 181             HomeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 182             .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, HomeLayout.createSequentialGroup()
 183                 .addContainerGap(369, Short.MAX_VALUE)
 184                 .addGroup(HomeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 185                     .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, HomeLayout.createSequentialGroup()
 186                         .addComponent(inventoryCheckButton, javax.swing.GroupLayout.PREFERRED_SIZE, 215, javax.swing.GroupLayout.PREFERRED_SIZE)
 187                         .addGap(310, 310, 310))
 188                     .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, HomeLayout.createSequentialGroup()
 189                         .addComponent(transactionHistoryButton, javax.swing.GroupLayout.PREFERRED_SIZE, 235, javax.swing.GroupLayout.PREFERRED_SIZE)
 190                         .addGap(298, 298, 298))))
 191             .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, HomeLayout.createSequentialGroup()
 192                 .addGap(0, 0, Short.MAX_VALUE)
 193                 .addGroup(HomeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 194                     .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, HomeLayout.createSequentialGroup()
 195                         .addComponent(buyButton, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE)
 196                         .addGap(372, 372, 372))
 197                     .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, HomeLayout.createSequentialGroup()
 198                         .addComponent(Welcome, javax.swing.GroupLayout.PREFERRED_SIZE, 536, javax.swing.GroupLayout.PREFERRED_SIZE)
 199                         .addGap(136, 136, 136))))
 200         );
 201         HomeLayout.setVerticalGroup(
 202             HomeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 203             .addGroup(HomeLayout.createSequentialGroup()
 204                 .addGap(50, 50, 50)
 205                 .addComponent(Welcome)
 206                 .addGap(66, 66, 66)
 207                 .addComponent(buyButton, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
 208                 .addGap(18, 18, 18)
 209                 .addComponent(inventoryCheckButton, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
 210                 .addGap(18, 18, 18)
 211                 .addComponent(transactionHistoryButton, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
 212                 .addContainerGap(151, Short.MAX_VALUE))
 213         );
 214 
 215         Main.addTab("Home", Home);
 216 
 217         boughtShoeNameLabel.setText("Name of the Shoe:");
 218 
 219         boughtShoeGenderLabel.setText("Gender:");
 220 
 221         boughtShoeSizeLabel.setText("Size (US):");
 222 
 223         dateShoeBoughtLabel.setText("Date Bought:");
 224 
 225         buyingPriceLabel.setText("Buying Price (USD $):");
 226 
 227         boughtShoeSizeSpinner.setModel(new javax.swing.SpinnerNumberModel(0.0d, null, null, 0.5d));
 228 
 229         boughtShoeGenderComboBox.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "-----", "Mens", "Womens", "Childrens (Boys)", "Childrens (Girls)" }));
 230         boughtShoeGenderComboBox.addActionListener(new java.awt.event.ActionListener() {
 231             public void actionPerformed(java.awt.event.ActionEvent evt) {
 232                 boughtShoeGenderComboBoxActionPerformed(evt);
 233             }
 234         });
 235 
 236         dateBoughtDayTF.setText("DD");
 237         dateBoughtDayTF.addMouseListener(new java.awt.event.MouseAdapter() {
 238             public void mouseReleased(java.awt.event.MouseEvent evt) {
 239                 dateBoughtDayTFMouseReleased(evt);
 240             }
 241         });
 242 
 243         dateBoughtMonthTF.setText("MM");
 244         dateBoughtMonthTF.addMouseListener(new java.awt.event.MouseAdapter() {
 245             public void mouseReleased(java.awt.event.MouseEvent evt) {
 246                 dateBoughtMonthTFMouseReleased(evt);
 247             }
 248         });
 249 
 250         dateBoughtYearTF.setText("YYYY");
 251         dateBoughtYearTF.addMouseListener(new java.awt.event.MouseAdapter() {
 252             public void mouseReleased(java.awt.event.MouseEvent evt) {
 253                 dateBoughtYearTFMouseReleased(evt);
 254             }
 255         });
 256 
 257         boughtDateSeparator.setText("/");
 258 
 259         boughtDateSeparator2.setText("/");
 260 
 261         boughtShoeBrandLabel.setText("Brand:");
 262 
 263         boughtShoeCollaborationLabel.setText("Collaboration:");
 264 
 265         boughtShoeConfirmationButton.setText("OK");
 266         boughtShoeConfirmationButton.addMouseListener(new java.awt.event.MouseAdapter() {
 267             public void mouseReleased(java.awt.event.MouseEvent evt) {
 268                 boughtShoeConfirmationButtonMouseReleased(evt);
 269             }
 270         });
 271 
 272         javax.swing.GroupLayout BuyingLayout = new javax.swing.GroupLayout(Buying);
 273         Buying.setLayout(BuyingLayout);
 274         BuyingLayout.setHorizontalGroup(
 275             BuyingLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 276             .addGroup(BuyingLayout.createSequentialGroup()
 277                 .addContainerGap(336, Short.MAX_VALUE)
 278                 .addGroup(BuyingLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 279                     .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, BuyingLayout.createSequentialGroup()
 280                         .addGroup(BuyingLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 281                             .addGroup(BuyingLayout.createSequentialGroup()
 282                                 .addGroup(BuyingLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 283                                     .addGroup(BuyingLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
 284                                         .addComponent(dateShoeBoughtLabel)
 285                                         .addComponent(buyingPriceLabel))
 286                                     .addComponent(boughtShoeGenderLabel, javax.swing.GroupLayout.Alignment.TRAILING)
 287                                     .addComponent(boughtShoeSizeLabel, javax.swing.GroupLayout.Alignment.TRAILING))
 288                                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 289                                 .addGroup(BuyingLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 290                                     .addComponent(boughtShoeGenderComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
 291                                     .addComponent(boughtShoePriceSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
 292                                     .addGroup(BuyingLayout.createSequentialGroup()
 293                                         .addGap(6, 6, 6)
 294                                         .addComponent(dateBoughtDayTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
 295                                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 296                                         .addComponent(boughtDateSeparator)
 297                                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 298                                         .addComponent(dateBoughtMonthTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
 299                                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 300                                         .addComponent(boughtDateSeparator2)
 301                                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 302                                         .addComponent(dateBoughtYearTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
 303                                     .addComponent(boughtShoeSizeSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)))
 304                             .addGroup(BuyingLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 305                                 .addGroup(BuyingLayout.createSequentialGroup()
 306                                     .addComponent(boughtShoeNameLabel)
 307                                     .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 308                                     .addComponent(boughtShoeNameTF, javax.swing.GroupLayout.PREFERRED_SIZE, 205, javax.swing.GroupLayout.PREFERRED_SIZE))
 309                                 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, BuyingLayout.createSequentialGroup()
 310                                     .addComponent(boughtShoeBrandLabel)
 311                                     .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 312                                     .addComponent(boughtShoeBrandTF, javax.swing.GroupLayout.PREFERRED_SIZE, 205, javax.swing.GroupLayout.PREFERRED_SIZE))
 313                                 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, BuyingLayout.createSequentialGroup()
 314                                     .addComponent(boughtShoeCollaborationLabel)
 315                                     .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 316                                     .addComponent(boughtShoeCollaborationTF, javax.swing.GroupLayout.PREFERRED_SIZE, 205, javax.swing.GroupLayout.PREFERRED_SIZE))))
 317                         .addGap(267, 267, 267))
 318                     .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, BuyingLayout.createSequentialGroup()
 319                         .addComponent(boughtShoeConfirmationButton)
 320                         .addGap(120, 120, 120))))
 321         );
 322         BuyingLayout.setVerticalGroup(
 323             BuyingLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 324             .addGroup(BuyingLayout.createSequentialGroup()
 325                 .addGap(40, 40, 40)
 326                 .addGroup(BuyingLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
 327                     .addComponent(boughtShoeNameLabel)
 328                     .addComponent(boughtShoeNameTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
 329                 .addGap(18, 18, 18)
 330                 .addGroup(BuyingLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
 331                     .addComponent(boughtShoeBrandLabel)
 332                     .addComponent(boughtShoeBrandTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
 333                 .addGap(18, 18, 18)
 334                 .addGroup(BuyingLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
 335                     .addComponent(boughtShoeCollaborationLabel)
 336                     .addComponent(boughtShoeCollaborationTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
 337                 .addGap(18, 18, 18)
 338                 .addGroup(BuyingLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
 339                     .addComponent(buyingPriceLabel)
 340                     .addComponent(boughtShoePriceSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
 341                 .addGap(23, 23, 23)
 342                 .addGroup(BuyingLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 343                     .addGroup(BuyingLayout.createSequentialGroup()
 344                         .addGap(34, 34, 34)
 345                         .addGroup(BuyingLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
 346                             .addComponent(boughtShoeSizeLabel)
 347                             .addComponent(boughtShoeSizeSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
 348                         .addGap(18, 18, 18)
 349                         .addGroup(BuyingLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
 350                             .addComponent(dateShoeBoughtLabel)
 351                             .addComponent(dateBoughtDayTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
 352                             .addComponent(dateBoughtMonthTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
 353                             .addComponent(dateBoughtYearTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
 354                             .addComponent(boughtDateSeparator)
 355                             .addComponent(boughtDateSeparator2)))
 356                     .addGroup(BuyingLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
 357                         .addComponent(boughtShoeGenderComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
 358                         .addComponent(boughtShoeGenderLabel)))
 359                 .addGap(26, 26, 26)
 360                 .addComponent(boughtShoeConfirmationButton)
 361                 .addContainerGap(164, Short.MAX_VALUE))
 362         );
 363 
 364         Main.addTab("Buying", Buying);
 365 
 366         InventoryTable.setModel(new javax.swing.table.DefaultTableModel(
 367             new Object [][] {
 368 
 369             },
 370             new String [] {
 371                 "Shoe Name", "Brand", "Size", "Collaboration", "Gender", "Date Bought"
 372             }
 373         ) {
 374             Class[] types = new Class [] {
 375                 java.lang.String.class, java.lang.String.class, java.lang.Double.class, java.lang.String.class, java.lang.String.class, java.lang.String.class
 376             };
 377             boolean[] canEdit = new boolean [] {
 378                 false, false, false, false, false, false
 379             };
 380 
 381             public Class getColumnClass(int columnIndex) {
 382                 return types [columnIndex];
 383             }
 384 
 385             public boolean isCellEditable(int rowIndex, int columnIndex) {
 386                 return canEdit [columnIndex];
 387             }
 388         });
 389         InventoryTable.setToolTipText("");
 390         InventoryTable.setGridColor(new java.awt.Color(0, 0, 0));
 391         InventoryTable.addMouseListener(new java.awt.event.MouseAdapter() {
 392             public void mouseClicked(java.awt.event.MouseEvent evt) {
 393                 InventoryTableMouseClicked(evt);
 394             }
 395         });
 396         InventoryPage.setViewportView(InventoryTable);
 397         if (InventoryTable.getColumnModel().getColumnCount() > 0) {
 398             InventoryTable.getColumnModel().getColumn(0).setResizable(false);
 399             InventoryTable.getColumnModel().getColumn(1).setResizable(false);
 400             InventoryTable.getColumnModel().getColumn(2).setResizable(false);
 401             InventoryTable.getColumnModel().getColumn(3).setResizable(false);
 402             InventoryTable.getColumnModel().getColumn(4).setResizable(false);
 403             InventoryTable.getColumnModel().getColumn(5).setResizable(false);
 404         }
 405 
 406         sortByInventoryComboBox.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "-----", "Name", "Brand", "Size", "Collaboration" }));
 407 
 408         sortByLabelforInventory.setText("Sort By:");
 409 
 410         searchByLabelForInventory.setText("Search By:");
 411 
 412         inventorySearchByComboBox.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "-----", "Name", "Brand", "Size", "Collaboration" }));
 413         inventorySearchByComboBox.addActionListener(new java.awt.event.ActionListener() {
 414             public void actionPerformed(java.awt.event.ActionEvent evt) {
 415                 inventorySearchByComboBoxActionPerformed(evt);
 416             }
 417         });
 418 
 419         inventoryRefreshButton.setText("Refresh");
 420         inventoryRefreshButton.addActionListener(new java.awt.event.ActionListener() {
 421             public void actionPerformed(java.awt.event.ActionEvent evt) {
 422                 inventoryRefreshButtonActionPerformed(evt);
 423             }
 424         });
 425 
 426         inventorySearchResultLabel.setFont(new java.awt.Font("Lucida Grande", 1, 13)); // NOI18N
 427         inventorySearchResultLabel.setText("Sell Selected:");
 428 
 429         inventorySearchResult.setText("          ");
 430 
 431         inventorySearchButton.setText("Search");
 432         inventorySearchButton.addActionListener(new java.awt.event.ActionListener() {
 433             public void actionPerformed(java.awt.event.ActionEvent evt) {
 434                 inventorySearchButtonActionPerformed(evt);
 435             }
 436         });
 437 
 438         soldDay.setText("DD");
 439         soldDay.addMouseListener(new java.awt.event.MouseAdapter() {
 440             public void mouseReleased(java.awt.event.MouseEvent evt) {
 441                 soldDayMouseReleased(evt);
 442             }
 443         });
 444         soldDay.addActionListener(new java.awt.event.ActionListener() {
 445             public void actionPerformed(java.awt.event.ActionEvent evt) {
 446                 soldDayActionPerformed(evt);
 447             }
 448         });
 449 
 450         soldYear.setText("YYYY");
 451         soldYear.addMouseListener(new java.awt.event.MouseAdapter() {
 452             public void mouseReleased(java.awt.event.MouseEvent evt) {
 453                 soldYearMouseReleased(evt);
 454             }
 455         });
 456 
 457         soldMonth.setText("MM");
 458         soldMonth.addMouseListener(new java.awt.event.MouseAdapter() {
 459             public void mouseReleased(java.awt.event.MouseEvent evt) {
 460                 soldMonthMouseReleased(evt);
 461             }
 462         });
 463 
 464         sell.setText("Sell");
 465         sell.addMouseListener(new java.awt.event.MouseAdapter() {
 466             public void mouseReleased(java.awt.event.MouseEvent evt) {
 467                 sellMouseReleased(evt);
 468             }
 469         });
 470         sell.addActionListener(new java.awt.event.ActionListener() {
 471             public void actionPerformed(java.awt.event.ActionEvent evt) {
 472                 sellActionPerformed(evt);
 473             }
 474         });
 475 
 476         searchByLabelForInventory1.setText("Sold price");
 477 
 478         javax.swing.GroupLayout InventoryLayout = new javax.swing.GroupLayout(Inventory);
 479         Inventory.setLayout(InventoryLayout);
 480         InventoryLayout.setHorizontalGroup(
 481             InventoryLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 482             .addGroup(InventoryLayout.createSequentialGroup()
 483                 .addContainerGap()
 484                 .addComponent(InventoryPage, javax.swing.GroupLayout.PREFERRED_SIZE, 541, javax.swing.GroupLayout.PREFERRED_SIZE)
 485                 .addGroup(InventoryLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 486                     .addGroup(InventoryLayout.createSequentialGroup()
 487                         .addGap(18, 18, Short.MAX_VALUE)
 488                         .addGroup(InventoryLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 489                             .addGroup(InventoryLayout.createSequentialGroup()
 490                                 .addComponent(searchByLabelForInventory)
 491                                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 492                                 .addComponent(inventorySearchByComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE))
 493                             .addGroup(InventoryLayout.createSequentialGroup()
 494                                 .addComponent(sortByLabelforInventory)
 495                                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
 496                                 .addComponent(sortByInventoryComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
 497                             .addComponent(inventorySearchField, javax.swing.GroupLayout.PREFERRED_SIZE, 177, javax.swing.GroupLayout.PREFERRED_SIZE)
 498                             .addComponent(inventorySearchResultLabel)
 499                             .addGroup(InventoryLayout.createSequentialGroup()
 500                                 .addGroup(InventoryLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 501                                     .addComponent(sell)
 502                                     .addGroup(InventoryLayout.createSequentialGroup()
 503                                         .addGroup(InventoryLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 504                                             .addGroup(InventoryLayout.createSequentialGroup()
 505                                                 .addComponent(soldDay, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
 506                                                 .addGap(11, 11, 11))
 507                                             .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, InventoryLayout.createSequentialGroup()
 508                                                 .addComponent(searchByLabelForInventory1)
 509                                                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
 510                                         .addGroup(InventoryLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 511                                             .addGroup(InventoryLayout.createSequentialGroup()
 512                                                 .addComponent(soldMonth, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
 513                                                 .addGap(18, 18, 18)
 514                                                 .addComponent(soldYear, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE))
 515                                             .addComponent(FinalSellingPrice, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))))
 516                                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 517                                 .addComponent(inventorySearchResult, javax.swing.GroupLayout.PREFERRED_SIZE, 213, javax.swing.GroupLayout.PREFERRED_SIZE))
 518                             .addComponent(inventorySearchButton)
 519                             .addComponent(inventoryRefreshButton))
 520                         .addGap(49, 49, 49))
 521                     .addGroup(InventoryLayout.createSequentialGroup()
 522                         .addGap(182, 182, 182)
 523                         .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 0, javax.swing.GroupLayout.PREFERRED_SIZE)
 524                         .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
 525         );
 526         InventoryLayout.setVerticalGroup(
 527             InventoryLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 528             .addGroup(InventoryLayout.createSequentialGroup()
 529                 .addContainerGap()
 530                 .addComponent(InventoryPage, javax.swing.GroupLayout.DEFAULT_SIZE, 480, Short.MAX_VALUE)
 531                 .addContainerGap())
 532             .addGroup(InventoryLayout.createSequentialGroup()
 533                 .addGap(22, 22, 22)
 534                 .addGroup(InventoryLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 535                     .addGroup(InventoryLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
 536                         .addComponent(sortByInventoryComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
 537                         .addComponent(sortByLabelforInventory))
 538                     .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 0, javax.swing.GroupLayout.PREFERRED_SIZE))
 539                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
 540                 .addComponent(inventoryRefreshButton)
 541                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
 542                 .addGroup(InventoryLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
 543                     .addComponent(inventorySearchByComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
 544                     .addComponent(searchByLabelForInventory))
 545                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
 546                 .addComponent(inventorySearchField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
 547                 .addGap(18, 18, 18)
 548                 .addComponent(inventorySearchButton)
 549                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
 550                 .addComponent(inventorySearchResultLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
 551                 .addGap(18, 18, 18)
 552                 .addGroup(InventoryLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 553                     .addComponent(inventorySearchResult, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE)
 554                     .addGroup(InventoryLayout.createSequentialGroup()
 555                         .addGroup(InventoryLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
 556                             .addComponent(soldYear, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
 557                             .addComponent(soldDay, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
 558                             .addComponent(soldMonth, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
 559                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
 560                         .addGroup(InventoryLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
 561                             .addComponent(FinalSellingPrice, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
 562                             .addComponent(searchByLabelForInventory1))))
 563                 .addGap(3, 3, 3)
 564                 .addComponent(sell)
 565                 .addGap(62, 62, 62))
 566         );
 567 
 568         Main.addTab("Inventory", Inventory);
 569 
 570         searchLargetLabel.setText("Search Largest:");
 571 
 572         searchForComboBox.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "-----", "Brand", "Size", "Collaboration" }));
 573         searchForComboBox.addActionListener(new java.awt.event.ActionListener() {
 574             public void actionPerformed(java.awt.event.ActionEvent evt) {
 575                 searchForComboBoxActionPerformed(evt);
 576             }
 577         });
 578 
 579         transactionTableRefreshButton.setText("Refresh");
 580         transactionTableRefreshButton.addActionListener(new java.awt.event.ActionListener() {
 581             public void actionPerformed(java.awt.event.ActionEvent evt) {
 582                 transactionTableRefreshButtonActionPerformed(evt);
 583             }
 584         });
 585 
 586         TransactionTable.setModel(new javax.swing.table.DefaultTableModel(
 587             new Object [][] {
 588 
 589             },
 590             new String [] {
 591                 "Shoe Name", "Brand", "Size", "Collaboration", "Gender", "Date Bought", "Date Sold", "Profit/Loss"
 592             }
 593         ) {
 594             Class[] types = new Class [] {
 595                 java.lang.String.class, java.lang.String.class, java.lang.Double.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.Double.class
 596             };
 597             boolean[] canEdit = new boolean [] {
 598                 false, false, false, false, false, false, false, false
 599             };
 600 
 601             public Class getColumnClass(int columnIndex) {
 602                 return types [columnIndex];
 603             }
 604 
 605             public boolean isCellEditable(int rowIndex, int columnIndex) {
 606                 return canEdit [columnIndex];
 607             }
 608         });
 609         TransactionTable.setGridColor(new java.awt.Color(0, 0, 0));
 610         InventoryPage1.setViewportView(TransactionTable);
 611         if (TransactionTable.getColumnModel().getColumnCount() > 0) {
 612             TransactionTable.getColumnModel().getColumn(0).setResizable(false);
 613             TransactionTable.getColumnModel().getColumn(1).setResizable(false);
 614             TransactionTable.getColumnModel().getColumn(2).setResizable(false);
 615             TransactionTable.getColumnModel().getColumn(3).setResizable(false);
 616             TransactionTable.getColumnModel().getColumn(4).setResizable(false);
 617             TransactionTable.getColumnModel().getColumn(5).setResizable(false);
 618             TransactionTable.getColumnModel().getColumn(6).setResizable(false);
 619             TransactionTable.getColumnModel().getColumn(7).setResizable(false);
 620         }
 621 
 622         sortByTransactionComboBox.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "-----", "Name", "Brand", "Size", "Collaboration", "Profit", "Loss" }));
 623 
 624         sortByTransactionLabel.setText("Sort By:");
 625 
 626         searchForLabel.setText("For:");
 627 
 628         SearchSold.setText("Search");
 629         SearchSold.addActionListener(new java.awt.event.ActionListener() {
 630             public void actionPerformed(java.awt.event.ActionEvent evt) {
 631                 SearchSoldActionPerformed(evt);
 632             }
 633         });
 634 
 635         javax.swing.GroupLayout SalesHistoryLayout = new javax.swing.GroupLayout(SalesHistory);
 636         SalesHistory.setLayout(SalesHistoryLayout);
 637         SalesHistoryLayout.setHorizontalGroup(
 638             SalesHistoryLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 639             .addGroup(SalesHistoryLayout.createSequentialGroup()
 640                 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
 641                 .addGroup(SalesHistoryLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 642                     .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, SalesHistoryLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 643                         .addComponent(searchLargetLabel)
 644                         .addGroup(SalesHistoryLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 645                             .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, SalesHistoryLayout.createSequentialGroup()
 646                                 .addComponent(sortByTransactionLabel)
 647                                 .addGap(18, 18, 18)
 648                                 .addComponent(sortByTransactionComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
 649                             .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, SalesHistoryLayout.createSequentialGroup()
 650                                 .addComponent(transactionTableRefreshButton)
 651                                 .addContainerGap())))
 652                     .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, SalesHistoryLayout.createSequentialGroup()
 653                         .addComponent(searchForLabel)
 654                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
 655                         .addComponent(searchForComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
 656                         .addContainerGap())
 657                     .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, SalesHistoryLayout.createSequentialGroup()
 658                         .addComponent(SearchSold)
 659                         .addGap(17, 17, 17))
 660                     .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, SalesHistoryLayout.createSequentialGroup()
 661                         .addComponent(searchInputField, javax.swing.GroupLayout.PREFERRED_SIZE, 177, javax.swing.GroupLayout.PREFERRED_SIZE)
 662                         .addContainerGap())))
 663             .addGroup(SalesHistoryLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 664                 .addGroup(SalesHistoryLayout.createSequentialGroup()
 665                     .addGap(9, 9, 9)
 666                     .addComponent(InventoryPage1, javax.swing.GroupLayout.PREFERRED_SIZE, 624, javax.swing.GroupLayout.PREFERRED_SIZE)
 667                     .addContainerGap(269, Short.MAX_VALUE)))
 668         );
 669         SalesHistoryLayout.setVerticalGroup(
 670             SalesHistoryLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 671             .addGroup(SalesHistoryLayout.createSequentialGroup()
 672                 .addGap(20, 20, 20)
 673                 .addGroup(SalesHistoryLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
 674                     .addComponent(sortByTransactionComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
 675                     .addComponent(sortByTransactionLabel))
 676                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
 677                 .addComponent(transactionTableRefreshButton)
 678                 .addGap(24, 24, 24)
 679                 .addComponent(searchLargetLabel)
 680                 .addGap(18, 18, 18)
 681                 .addGroup(SalesHistoryLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
 682                     .addComponent(searchForComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
 683                     .addComponent(searchForLabel))
 684                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 685                 .addComponent(searchInputField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
 686                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 687                 .addComponent(SearchSold)
 688                 .addContainerGap(297, Short.MAX_VALUE))
 689             .addGroup(SalesHistoryLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 690                 .addGroup(SalesHistoryLayout.createSequentialGroup()
 691                     .addComponent(InventoryPage1, javax.swing.GroupLayout.PREFERRED_SIZE, 448, javax.swing.GroupLayout.PREFERRED_SIZE)
 692                     .addGap(0, 54, Short.MAX_VALUE)))
 693         );
 694 
 695         Main.addTab("Transaction History", SalesHistory);
 696 
 697         fileMenu.setMnemonic('f');
 698         fileMenu.setText("File");
 699 
 700         openMenuItem.setMnemonic('o');
 701         openMenuItem.setText("Open");
 702         fileMenu.add(openMenuItem);
 703 
 704         saveMenuItem.setMnemonic('s');
 705         saveMenuItem.setText("Save");
 706         fileMenu.add(saveMenuItem);
 707 
 708         saveAsMenuItem.setMnemonic('a');
 709         saveAsMenuItem.setText("Save As ...");
 710         saveAsMenuItem.setDisplayedMnemonicIndex(5);
 711         fileMenu.add(saveAsMenuItem);
 712 
 713         exitMenuItem.setMnemonic('x');
 714         exitMenuItem.setText("Exit");
 715         exitMenuItem.addActionListener(new java.awt.event.ActionListener() {
 716             public void actionPerformed(java.awt.event.ActionEvent evt) {
 717                 exitMenuItemActionPerformed(evt);
 718             }
 719         });
 720         fileMenu.add(exitMenuItem);
 721 
 722         menuBar.add(fileMenu);
 723 
 724         editMenu.setMnemonic('e');
 725         editMenu.setText("Edit");
 726 
 727         cutMenuItem.setMnemonic('t');
 728         cutMenuItem.setText("Cut");
 729         editMenu.add(cutMenuItem);
 730 
 731         copyMenuItem.setMnemonic('y');
 732         copyMenuItem.setText("Copy");
 733         editMenu.add(copyMenuItem);
 734 
 735         pasteMenuItem.setMnemonic('p');
 736         pasteMenuItem.setText("Paste");
 737         editMenu.add(pasteMenuItem);
 738 
 739         deleteMenuItem.setMnemonic('d');
 740         deleteMenuItem.setText("Delete");
 741         editMenu.add(deleteMenuItem);
 742 
 743         menuBar.add(editMenu);
 744 
 745         helpMenu.setMnemonic('h');
 746         helpMenu.setText("Help");
 747 
 748         contentsMenuItem.setMnemonic('c');
 749         contentsMenuItem.setText("Contents");
 750         helpMenu.add(contentsMenuItem);
 751 
 752         aboutMenuItem.setMnemonic('a');
 753         aboutMenuItem.setText("About");
 754         helpMenu.add(aboutMenuItem);
 755 
 756         menuBar.add(helpMenu);
 757 
 758         setJMenuBar(menuBar);
 759 
 760         javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
 761         getContentPane().setLayout(layout);
 762         layout.setHorizontalGroup(
 763             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 764             .addComponent(Main, javax.swing.GroupLayout.PREFERRED_SIZE, 907, Short.MAX_VALUE)
 765         );
 766         layout.setVerticalGroup(
 767             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 768             .addComponent(Main)
 769         );
 770 
 771         pack();
 772     }// </editor-fold>                        
 773     





               
1438 
1439     // Variables declaration - do not modify                     
1440     private javax.swing.JPanel Buying;
1441     private javax.swing.JSpinner FinalSellingPrice;
1442     private javax.swing.JPanel Home;
1443     private javax.swing.JPanel Inventory;
1444     private javax.swing.JScrollPane InventoryPage;
1445     private javax.swing.JScrollPane InventoryPage1;
1446     private javax.swing.JTable InventoryTable;
1447     private javax.swing.JTabbedPane Main;
1448     private javax.swing.JPanel SalesHistory;
1449     private javax.swing.JButton SearchSold;
1450     private javax.swing.JTable TransactionTable;
1451     private javax.swing.JLabel Welcome;
1452     private javax.swing.JMenuItem aboutMenuItem;
1453     private javax.swing.JLabel boughtDateSeparator;
1454     private javax.swing.JLabel boughtDateSeparator2;
1455     private javax.swing.JLabel boughtShoeBrandLabel;
1456     private javax.swing.JTextField boughtShoeBrandTF;
1457     private javax.swing.JLabel boughtShoeCollaborationLabel;
1458     private javax.swing.JTextField boughtShoeCollaborationTF;
1459     private javax.swing.JButton boughtShoeConfirmationButton;
1460     private javax.swing.JComboBox<String> boughtShoeGenderComboBox;
1461     private javax.swing.JLabel boughtShoeGenderLabel;
1462     private javax.swing.JLabel boughtShoeNameLabel;
1463     private javax.swing.JTextField boughtShoeNameTF;
1464     private javax.swing.JSpinner boughtShoePriceSpinner;
1465     private javax.swing.JLabel boughtShoeSizeLabel;
1466     private javax.swing.JSpinner boughtShoeSizeSpinner;
1467     private javax.swing.JButton buyButton;
1468     private javax.swing.JLabel buyingPriceLabel;
1469     private javax.swing.JMenuItem contentsMenuItem;
1470     private javax.swing.JMenuItem copyMenuItem;
1471     private javax.swing.JMenuItem cutMenuItem;
1472     private javax.swing.JTextField dateBoughtDayTF;
1473     private javax.swing.JTextField dateBoughtMonthTF;
1474     private javax.swing.JTextField dateBoughtYearTF;
1475     private javax.swing.JLabel dateShoeBoughtLabel;
1476     private javax.swing.JMenuItem deleteMenuItem;
1477     private javax.swing.JMenu editMenu;
1478     private javax.swing.JMenuItem exitMenuItem;
1479     private javax.swing.JMenu fileMenu;
1480     private javax.swing.JMenu helpMenu;
1481     private javax.swing.JButton inventoryCheckButton;
1482     private javax.swing.JButton inventoryRefreshButton;
1483     private javax.swing.JButton inventorySearchButton;
1484     private javax.swing.JComboBox<String> inventorySearchByComboBox;
1485     private javax.swing.JTextField inventorySearchField;
1486     private javax.swing.JLabel inventorySearchResult;
1487     private javax.swing.JLabel inventorySearchResultLabel;
1488     private javax.swing.JFrame jFrame1;
1489     private javax.swing.JLabel jLabel4;
1490     private javax.swing.JMenuBar menuBar;
1491     private javax.swing.JMenuItem openMenuItem;
1492     private javax.swing.JMenuItem pasteMenuItem;
1493     private javax.swing.JMenuItem saveAsMenuItem;
1494     private javax.swing.JMenuItem saveMenuItem;
1495     private javax.swing.JLabel searchByLabelForInventory;
1496     private javax.swing.JLabel searchByLabelForInventory1;
1497     private javax.swing.JComboBox<String> searchForComboBox;
1498     private javax.swing.JLabel searchForLabel;
1499     private javax.swing.JTextField searchInputField;
1500     private javax.swing.JLabel searchLargetLabel;
1501     private javax.swing.JButton sell;
1502     private javax.swing.JTextField soldDay;
1503     private javax.swing.JTextField soldMonth;
1504     private javax.swing.JTextField soldYear;
1505     private javax.swing.JComboBox<String> sortByInventoryComboBox;
1506     private javax.swing.JLabel sortByLabelforInventory;
1507     private javax.swing.JComboBox<String> sortByTransactionComboBox;
1508     private javax.swing.JLabel sortByTransactionLabel;
1509     private javax.swing.JButton transactionHistoryButton;
1510     private javax.swing.JButton transactionTableRefreshButton;
1511     // End of variables declaration                   
1512 
1513 }
1514