/Users/20442/NetBeansProjects/Real IA/src/MainGUIComponents.java

   1 

   2 import java.awt.Image;

   3 import java.awt.image.BufferedImage;

   4 import java.io.BufferedWriter;

   5 import java.io.IOException;

   6 import java.util.ArrayList;

   7 import java.io.BufferedReader;

   8 import java.io.File;

   9 import java.io.FileInputStream;

  10 import java.io.FileOutputStream;

  11 import java.io.InputStreamReader;

  12 import java.io.OutputStreamWriter;

  13 import javax.imageio.ImageIO;

  14 import javax.swing.ImageIcon;

  15 import javax.swing.JFileChooser;

  16 import javax.swing.JFrame;

  17 import javax.swing.JOptionPane;

  18 import static javax.swing.JOptionPane.ERROR_MESSAGE;

  19 

  20 /*

  21  * To change this license header, choose License Headers in Project Properties.

  22  * To change this template file, choose Tools | Templates

  23  * and open the template in the editor.

  24  */

  25 /**

  26  *

  27  * @author 20442

  28  */

  29 

  30 /*

  31 Extensiblity Lists

  32 

  33 - Add extra JOptionPanes which act as step-by-step instructions to properly go through the input of student information process.

  34     -   Also JOptionPanes to help the client to check the validity of information formatting

  35 

  36 - Export Table Date to an excel file or google sheets

  37 

  38 - Button that will clean the table

  39 

  40 - Make the combo box refresh in the Query Tab, rather than when clicking on the Refresh button.

  41 

  42 

  43 */

  44 

  45 

  46 

  47 // arraylist was used for potential increase in class size

  48 

  49 public class MainGUIComponents extends javax.swing.JFrame {

  50 

  51     /**

  52      * Creates new form PreliminaryPrototype

  53      */

  54     ArrayList<Student> students = fileReadForStudents(); // Data read from studentInfo text file

  55     ArrayList<VisaInformation> visainformation = fileReadForVisaInformation(); // Data read from visaInfo text file

  56     ArrayList<VisaInformation> visaRequiredStudents = new ArrayList<VisaInformation>();

  57 

  58     

  59     public MainGUIComponents() {

  60         initComponents();

  61 

  62         //Automatically add full name of the  students to the  visa information tab combo box.

  63         for (int i = 0; i < students.size(); i++) {

  64             String fullName = students.get(i).getFirstName() + " " + students.get(i).getLastName();

  65             studentNameVisaComboBox.addItem(fullName);

  66         }

  67        

  68 

  69     }

  70 

  71    //assign variables to each column for display in Display Tab

  72     private void refreshDisplayTableForStudentInformation() {

  73         for (int row = 0; row < students.size(); row++) {

  74             displayTable.setValueAt(students.get(row).getLastName(), row, 0);

  75             displayTable.setValueAt(students.get(row).getFirstName(), row, 1);

  76             displayTable.setValueAt(students.get(row).getIdNum(), row, 2);

  77             displayTable.setValueAt(students.get(row).getGrade(), row, 3);

  78             displayTable.setValueAt(students.get(row).getYear(), row, 4);

  79 

  80             if (row < visainformation.size()) {

  81                 displayTable.setValueAt(visainformation.get(row).getVisaRequired(), row, 5);

  82                 displayTable.setValueAt(visainformation.get(row).getVisaTurnedIn(), row, 6);

  83             }

  84         }

  85 

  86     }

  87    // assign varuables to each column for display in Query Tab

  88     private void refreshDisplayTableForVisaInformation() {

  89         for (int row = 0; row < visaRequiredStudents.size(); row++) {

  90 

  91             displayQueryTable.setValueAt(visaRequiredStudents.get(row).getFullName(), row, 0);

  92             displayQueryTable.setValueAt(visaRequiredStudents.get(row).getPassportExpiryDate(), row, 1);

  93             displayQueryTable.setValueAt(visaRequiredStudents.get(row).getVisaExpiryDate(), row, 2);

  94         }

  95     }

  96     //Add students who need visa to visaRequiredStudents arraylist and to combo box in Query Tab

  97     private void visaRequiredForStudents() {

  98         searchComboBox.removeAllItems();

  99         for (int i = 0; i < visainformation.size(); i++) {

 100             if (visainformation.get(i).getVisaRequired()) {

 101                 searchComboBox.addItem(visainformation.get(i).getFullName());

 102                 visaRequiredStudents.add(visainformation.get(i));

 103             }

 104         }

 105     }

 106     //Set the text fields to appropriate information from visa information arraylist

 107     private void visaQueryVisaInformation() {

 108         for (int i = 0; i < visaRequiredStudents.size(); i++) {

 109             if (searchComboBox.getSelectedItem().equals(visaRequiredStudents.get(i).getFullName())) {

 110                 searchPassportNationalityTF.setText(visaRequiredStudents.get(i).getPassportNationality() + "");

 111                 searchPassportNumberTF.setText(visaRequiredStudents.get(i).getPassportNumber() + "");

 112                 searchPassportExpiryDateTF.setText(visaRequiredStudents.get(i).getPassportExpiryDate() + "");

 113                 searchVisaNumTF.setText(visaRequiredStudents.get(i).getVisaNumber() + "");

 114                 searchVisaExpiryDateTF.setText(visaRequiredStudents.get(i).getVisaExpiryDate() + "");

 115                 searchVisaTurnedInTF.setText(visaRequiredStudents.get(i).getVisaTurnedIn() + "");

 116             }

 117         }

 118     }

 119     //Select the row and edit information from that row in the student arraylist.

 120     private void editStudentInfo() {

 121         JFrame f;

 122         f = new JFrame();

 123         if (JOptionPane.showConfirmDialog(f, "Are you sure?") == JOptionPane.YES_OPTION) {

 124             int row = Integer.parseInt(rowToChooseStudentTF.getText()) - 1;

 125             students.get(row).setLastName(editLastNameTF.getText());

 126             students.get(row).setFirstName(editFirstNameTF.getText());

 127             students.get(row).setIdNum(Integer.parseInt(editIdNumTF.getText()));

 128             students.get(row).setGrade(editGradeComboBox.getSelectedItem() + "");

 129             students.get(row).setYear(Integer.parseInt(editYearTF.getText()));

 130         } 

 131     }

 132     //Select the row and edit information from that row in the visa information arraylist.

 133     private void editVisaInfo() {

 134         JFrame f;

 135         f = new JFrame();

 136         if (JOptionPane.showConfirmDialog(f, "Are you sure?") == JOptionPane.YES_OPTION) {

 137             int row = Integer.parseInt(rowToChooseVisaTF.getText()) - 1;

 138             visainformation.get(row).setPassportNationality(editPassportNationalityTF.getText());

 139             visainformation.get(row).setPassportNumber(editPassportNumberTF.getText());

 140             visainformation.get(row).setPassportExpiryDate(Integer.parseInt(editPassportExpiryDateTF.getText()));

 141             visainformation.get(row).setVisaRequired(editVisaRequiredCheckBox.isSelected());

 142             visainformation.get(row).setVisaTurnedIn(editVisaTurnedInCheckBox.isSelected());

 143             visainformation.get(row).setVisaNumber(editVisaNumberTF.getText());

 144             visainformation.get(row).setVisaExpiryDate(Integer.parseInt(editVisaExpiryDateTF.getText()));            

 145         }

 146     }

 147     //Loop through the VisaInformation ArrayList.

 148     //Switch to whatever the newly typed information is only if the old name is equal to the preexisting name. 

 149     //This is done so the change of name in student ArrayList would also be applied in VisaInformation. 

 150     private void searchEditName(String oldName){

 151         for(int i=0; i<students.size(); i++) {            

 152             if((visainformation.get(i).getFullName()).equals(oldName)) {

 153                 visainformation.get(i).setFullName(students.get(i).getFirstName() + " " 

 154                         + students.get(i).getLastName());

 155             }

 156         }

 157     }

 158     

 159 // File Save and File Read Functions

 160 //File Save Students. Will save student data to a studentInfo TextFile

 161     

 162     private void fileSaveForStudents(ArrayList<Student> students) {

 163         BufferedWriter bw = null;

 164         String testFile = "./studentInfo.text";

 165         File file = new File(testFile);

 166         if (file.exists()) {

 167             file.delete();

 168         }

 169         try {

 170             file.createNewFile();

 171         } catch (IOException e) {

 172             e.printStackTrace();

 173         }

 174 

 175         try {

 176             bw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file, false), "UTF-8"));

 177             StringBuilder data = new StringBuilder();

 178             for (int i = 0; i < students.size(); i++) {

 179                 data.append(students.get(i).getLastName());

 180                 data.append("," + students.get(i).getFirstName());

 181                 data.append("," + students.get(i).getIdNum());

 182                 data.append("," + students.get(i).getGrade());

 183                 data.append("," + students.get(i).getYear());

 184                 data.append("\n");

 185             }

 186             System.out.println(data);

 187             bw.write(data.toString());

 188         } catch (Exception e) {

 189             e.printStackTrace();

 190         } finally {

 191             try {

 192                 if (bw != null) {

 193                     bw.close();

 194                 }

 195             } catch (IOException e) {

 196                 e.printStackTrace();

 197             }

 198         }

 199         System.out.println("File is written successfully");

 200     }

 201 // File Read Students. Will be loaded when the program is runned.

 202 

 203     private static ArrayList<Student> fileReadForStudents() {

 204         String path = "./studentInfo.text";

 205         BufferedReader br = null;

 206         ArrayList<Student> students = new ArrayList<Student>();

 207         File file = new File(path);

 208         String read = "";

 209         try {

 210             if (file.exists()) {

 211                 FileInputStream fileInputStream = new FileInputStream(path);

 212                 InputStreamReader inputStreamReader = new InputStreamReader(fileInputStream, "UTF-8");

 213                 br = new BufferedReader(inputStreamReader);

 214                 String infoData = null;

 215                 while ((infoData = br.readLine()) != null) {

 216                     read += infoData;

 217                     read += "\n";

 218                 }

 219                 //System.out.println(read);

 220 //                              System.out.println("----------" + studentsInfo);

 221                 br.close();

 222 

 223                 String[] infoArr = read.split("\n");

 224                 for (int i = 0; i < infoArr.length; i++) {

 225                     Student add = new Student();

 226                     students.add(add);

 227                     String[] stuArr = infoArr[i].split(",");

 228 

 229                     if (stuArr.length > 0) {

 230                         students.get(i).setLastName(stuArr[0]);

 231                         students.get(i).setFirstName(stuArr[1]);

 232                         students.get(i).setIdNum(Integer.parseInt(stuArr[2]));

 233                         students.get(i).setGrade(stuArr[3]);

 234                         students.get(i).setYear(Integer.parseInt(stuArr[4]));

 235                     }

 236                 }

 237             }

 238         } catch (IOException e) {

 239             e.printStackTrace();

 240         } finally {

 241             if (br != null) {

 242                 try {

 243                     br.close();

 244                 } catch (IOException e) {

 245                     e.printStackTrace();

 246                 }

 247             }

 248         }

 249 

 250         return students;

 251 

 252     }

 253 

 254 // File Save Visa Information. Will save visa information data to a visaInfo Text File     

 255     private void fileSaveForVisaInformation(ArrayList<VisaInformation> visainformation) {

 256         BufferedWriter bw = null; // create bw variable

 257         String testFile = "./visaInfo.text"; //create a path

 258         File file = new File(testFile); // initialize file var 

 259         if (file.exists()) { // if the file with same name exists delete

 260             file.delete();

 261         }

 262         try {

 263             file.createNewFile(); //create a new file at that location 

 264         } catch (IOException e) {

 265             e.printStackTrace();  // printing out eror

 266         }

 267 

 268         try {

 269             bw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file, false), "UTF-8"));

 270             StringBuilder data = new StringBuilder();

 271             for (int i = 0; i < visainformation.size(); i++) { // save info/data with a comma for each variable

 272                 data.append(visainformation.get(i).getFullName());

 273                 data.append("," + visainformation.get(i).getPassportNationality());

 274                 data.append("," + visainformation.get(i).getPassportNumber());

 275                 data.append("," + visainformation.get(i).getPassportExpiryDate());

 276                 data.append("," + visainformation.get(i).getVisaRequired());

 277                 data.append("," + visainformation.get(i).getVisaTurnedIn());

 278                 data.append("," + visainformation.get(i).getVisaNumber());

 279                 data.append("," + visainformation.get(i).getVisaExpiryDate());

 280                 data.append("\n");

 281             } 

 282             System.out.println(data);

 283             bw.write(data.toString());

 284         } catch (Exception e) {

 285             e.printStackTrace();

 286         } finally {

 287             try {

 288                 if (bw != null) {

 289                     bw.close();

 290                 }

 291             } catch (IOException e) {

 292                 e.printStackTrace();

 293             }

 294         }

 295         System.out.println("File is written successfully");

 296     }

 297 

 298 //  File Read Visa Information. Will be loaded when the program is runned.

 299     private static ArrayList<VisaInformation> fileReadForVisaInformation() {

 300         String path = "./visaInfo.text"; // path

 301         BufferedReader br = null; // initialize

 302         ArrayList<VisaInformation> visainformation = new ArrayList<VisaInformation>(); // locally defining visa arraylist

 303         File file = new File(path);

 304         String read = ""; // initialize read variable

 305         try {

 306             if (file.exists()) {

 307                 FileInputStream fileInputStream = new FileInputStream(path);

 308                 InputStreamReader inputStreamReader = new InputStreamReader(fileInputStream, "UTF-8");

 309                 br = new BufferedReader(inputStreamReader);

 310                 String infoData = null;

 311                 while ((infoData = br.readLine()) != null) {

 312                     read += infoData;

 313                     read += "\n";

 314                 } // input everything in the text file to the read variable

 315                 // after each line put a symbol (means the line has ended)

 316 

 317                 br.close(); // finishing inputting data

 318 

 319                 String[] infoArr = read.split("\n"); // separate the entire string by a certain symbol

 320                 for (int i = 0; i < infoArr.length; i++) {

 321                     VisaInformation add = new VisaInformation();

 322                     visainformation.add(add);

 323                     String[] stuArr = infoArr[i].split(","); // separate each variable with a comma

 324 

 325                     if (stuArr.length > 0) {

 326                         visainformation.get(i).setFullName(stuArr[0]);

 327                         visainformation.get(i).setPassportNationality(stuArr[1]);

 328                         visainformation.get(i).setPassportNumber(stuArr[2]);

 329                         visainformation.get(i).setPassportExpiryDate(Integer.parseInt(stuArr[3]));

 330                         visainformation.get(i).setVisaRequired("true".equals(stuArr[4]));

 331                         visainformation.get(i).setVisaTurnedIn("true".equals(stuArr[5]));

 332                         visainformation.get(i).setVisaNumber(stuArr[6]);

 333                         visainformation.get(i).setVisaExpiryDate(Integer.parseInt(stuArr[7]));

 334                     }

 335                     // assign the data in each variable to the ArrayList VisaInformation

 336                 }

 337             }

 338         } catch (IOException e) {

 339             e.printStackTrace();

 340         } finally {

 341             if (br != null) {

 342                 try {

 343                     br.close();

 344                 } catch (IOException e) {

 345                     e.printStackTrace();

 346                 }

 347             }

 348         } // Error Handling

 349 

 350         return visainformation;

 351 

 352     }

 353     

 354     

 355 




1517 

1518     private void exitMenuItemActionPerformed(java.awt.event.ActionEvent evt) {                                             

1519         System.exit(0);

1520     }                                            

1521 

1522     private void refreshStudentListButtonMouseReleased(java.awt.event.MouseEvent evt) {                                                       

1523         // TODO add your handling code here:

1524         visaRequiredForStudents();

1525     }                                                      

1526 

1527     private void uploadImageButtonMouseReleased(java.awt.event.MouseEvent evt) {                                                

1528         // TODO add your handling code here:

1529         BufferedImage img;

1530         File file;

1531         //Using buffedimage and file class

1532         JFileChooser fileChooser = new JFileChooser(); //using file chooser

1533         fileChooser.showOpenDialog(null);

1534         file = fileChooser.getSelectedFile();

1535         try {

1536 

1537             img = ImageIO.read(file);

1538             Image resizedImage = img.getScaledInstance(imageInternalFrame.getWidth(),

1539             imageInternalFrame.getHeight(), Image.SCALE_SMOOTH);

1540             ImageIcon icon = new ImageIcon(resizedImage); // ADDED

1541             jLabel12.setIcon(icon); // ADDED

1542 

1543         } catch (IOException e1) {

1544             JOptionPane.showMessageDialog(null, "Please select an image.");

1545         }

1546 

1547         imageInternalFrame.setVisible(true);

1548     }                                               

1549 

1550     private void refreshQueryTableButtonMouseReleased(java.awt.event.MouseEvent evt) {                                                      

1551         // TODO add your handling code here:

1552         SortVisaInformation sortClass = new SortVisaInformation();

1553         if (displayVisaSortComboBox.getSelectedItem().equals("PassportExpiryDateAscending")) {

1554             sortClass.sortByPassportExpiryDateAscending(visaRequiredStudents);

1555         } else if (displayVisaSortComboBox.getSelectedItem().equals("PassportExpiryDateDescending")) {

1556             sortClass.sortByPassportExpiryDateDescending(visaRequiredStudents);

1557         } else if (displayVisaSortComboBox.getSelectedItem().equals("VisaExpiryDateAscending")) {

1558             sortClass.sortByVisaExpiryDateAscending(visaRequiredStudents);

1559         } else if (displayVisaSortComboBox.getSelectedItem().equals("VisaExpiryDateDescending")) {

1560             sortClass.sortByVisaExpiryDateDescending(visaRequiredStudents);

1561         }

1562         refreshDisplayTableForVisaInformation();

1563     }                                                     

1564 

1565     private void searchPassportNumberTFActionPerformed(java.awt.event.ActionEvent evt) {                                                       

1566         // TODO add your handling code here:

1567     }                                                      

1568 

1569     private void searchButtonActionPerformed(java.awt.event.ActionEvent evt) {                                             

1570         // TODO add your handling code here:

1571     }                                            

1572 

1573     private void searchButtonMouseReleased(java.awt.event.MouseEvent evt) {                                           

1574         // TODO add your handling code here:

1575         SortVisaInformation sortClass = new SortVisaInformation();

1576         visaQueryVisaInformation();

1577     }                                          

1578 

1579     private void searchVisaTurnedInTFActionPerformed(java.awt.event.ActionEvent evt) {                                                     

1580         // TODO add your handling code here:

1581     }                                                    

1582 

1583     private void searchVisaExpiryDateTFActionPerformed(java.awt.event.ActionEvent evt) {                                                       

1584         // TODO add your handling code here:

1585     }                                                      

1586 

1587     private void removeStudentButtonMouseReleased(java.awt.event.MouseEvent evt) {                                                  

1588         // TODO add your handling code here:

1589         JFrame f;

1590         f = new JFrame();

1591         int row = Integer.parseInt(rowToChooseStudentTF.getText()) - 1;

1592         if (JOptionPane.showConfirmDialog(f, "Are you sure?") == JOptionPane.YES_OPTION) {

1593             students.remove(row);

1594             visainformation.remove(row);   

1595         }

1596  

1597 

1598     }                                                 

1599 

1600     private void editYearTFActionPerformed(java.awt.event.ActionEvent evt) {                                           

1601         // TODO add your handling code here:

1602     }                                          

1603 

1604     private void showStudentButtonMouseReleased(java.awt.event.MouseEvent evt) {                                                

1605         // TODO add your handling code here:

1606         

1607 

1608         for(int row = 0; row <10; row++) {

1609             for(int column =0; column <4; column++) {

1610                 editTStudentable.setValueAt(null, row, column);

1611             }

1612         }

1613         

1614         students = fileReadForStudents();

1615         

1616  

1617         for (int row = 0; row < students.size(); row++) {

1618             editTStudentable.setValueAt(students.get(row).getLastName(), row, 0);

1619             editTStudentable.setValueAt(students.get(row).getFirstName(), row, 1);

1620             editTStudentable.setValueAt(students.get(row).getIdNum(), row, 2);

1621             editTStudentable.setValueAt(students.get(row).getGrade(), row, 3);

1622             editTStudentable.setValueAt(students.get(row).getYear(), row, 4);

1623         }

1624         

1625 

1626         

1627     }                                               

1628 

1629     private void saveStudentButtonMouseReleased(java.awt.event.MouseEvent evt) {                                                

1630         // TODO add your handling code here:

1631         JFrame f;

1632         f = new JFrame();

1633         int row = Integer.parseInt(rowToChooseStudentTF.getText()) - 1;

1634         if (JOptionPane.showConfirmDialog(f, "Are you sure?") == JOptionPane.YES_OPTION) {

1635             fileSaveForStudents(students);

1636             fileSaveForVisaInformation(visainformation);

1637         }

1638     }                                               

1639 

1640     private void editStudentButtonMouseReleased(java.awt.event.MouseEvent evt) {                                                

1641         // TODO add your handling code here:

1642         String oldName = students.get(Integer.parseInt(rowToChooseStudentTF.getText()) - 1).getFirstName() + " " 

1643                 + students.get(Integer.parseInt(rowToChooseStudentTF.getText()) - 1).getLastName();

1644         editStudentInfo();

1645         searchEditName(oldName);        

1646     }                                               

1647 

1648     private void displaySortComboBoxActionPerformed(java.awt.event.ActionEvent evt) {                                                    

1649         // TODO add your handling code here:

1650     }                                                   

1651 

1652     private void displaySortComboBoxMouseReleased(java.awt.event.MouseEvent evt) {                                                  

1653         // TODO add your handling code here:

1654     }                                                 

1655 

1656     private void refreshDisplayTableButtonActionPerformed(java.awt.event.ActionEvent evt) {                                                          

1657         // TODO add your handling code here:

1658     }                                                         

1659 

1660     private void refreshDisplayTableButtonMouseReleased(java.awt.event.MouseEvent evt) {                                                        

1661         // TODO add your handling code here:

1662        if(displaySortComboBox.getSelectedItem().equals("SelectToSort")) {

1663             students = fileReadForStudents();

1664         } else if (displaySortComboBox.getSelectedItem().equals("LastNameAscending")) {

1665             SortStudent sortClass = new SortStudent();

1666             sortClass.sortByLastNameAscending(students);

1667         } else if (displaySortComboBox.getSelectedItem().equals("LastNameDescending")) {

1668             SortStudent sortClass = new SortStudent();

1669             sortClass.sortByLastNameDescending(students);

1670         } else if (displaySortComboBox.getSelectedItem().equals("FirstNameAscending")) {

1671             SortStudent sortClass = new SortStudent();

1672             sortClass.sortByFirstNameAscending(students);

1673         } else if (displaySortComboBox.getSelectedItem().equals("FirstNameDescending")) {

1674             SortStudent sortClass = new SortStudent();

1675             sortClass.sortByFirstNameDescending(students);

1676         } else if (displaySortComboBox.getSelectedItem().equals("GradeAscending")) {

1677             SortStudent sortClass = new SortStudent();

1678             sortClass.sortByGradeAscending(students);

1679         } else if (displaySortComboBox.getSelectedItem().equals("GradeDescending")) {

1680             SortStudent sortClass = new SortStudent();

1681             sortClass.sortByGradeDescending(students);

1682         } else if (displaySortComboBox.getSelectedItem().equals("YearAscending")) {

1683             SortStudent sortClass = new SortStudent();

1684             sortClass.sortByYearAscending(students);

1685         } else if (displaySortComboBox.getSelectedItem().equals("YearDescending")) {

1686             SortStudent sortClass = new SortStudent();

1687             sortClass.sortByYearDescending(students);

1688         } else if (displaySortComboBox.getSelectedItem().equals("VisaRequiredYes")) {

1689             SortVisaInformation sortClass = new SortVisaInformation();

1690             sortClass.sortByVisaRequiredYes(visainformation);

1691         } else if (displaySortComboBox.getSelectedItem().equals("VisaRequiredNo")) {

1692             SortVisaInformation sortClass = new SortVisaInformation();

1693             sortClass.sortByVisaRequiredNo(visainformation);

1694         } else if (displaySortComboBox.getSelectedItem().equals("VisaTurnedInYes")) {

1695             SortVisaInformation sortClass = new SortVisaInformation();

1696             sortClass.sortByVisaTurnedInYes(visainformation);

1697         } else if (displaySortComboBox.getSelectedItem().equals("VisaTurnedInNo")) {

1698             SortVisaInformation sortClass = new SortVisaInformation();

1699             sortClass.sortByVisaTurnedInNo(visainformation);

1700         }

1701 

1702         refreshDisplayTableForStudentInformation();

1703     }                                                       

1704 

1705     private void visaTurnedInCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {                                                     

1706         // TODO add your handling code here:

1707     }                                                    

1708 

1709     private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {                                            

1710         // TODO add your handling code here:

1711     }                                           

1712 

1713     private void studentNameVisaComboBoxActionPerformed(java.awt.event.ActionEvent evt) {                                                        

1714         // TODO add your handling code here:

1715     }                                                       

1716 

1717     private void studentNameVisaComboBoxMouseClicked(java.awt.event.MouseEvent evt) {                                                     

1718         // TODO add your handling code here

1719     }                                                    

1720 

1721     private void visaInfoOKButtonActionPerformed(java.awt.event.ActionEvent evt) {                                                 

1722         // TODO add your handling code here:

1723     }                                                

1724 

1725     private void visaInfoOKButtonMouseReleased(java.awt.event.MouseEvent evt) {                                               

1726         // TODO add your handling code here:

1727 

1728         String fullName = studentNameVisaComboBox.getSelectedItem() + "";

1729         String passportNationality = passportNationalityTF.getText();

1730         String passportNumber = passportNumberTF.getText();

1731         int passportExpiryDate = Integer.parseInt(passportExpiryDateTF.getText());

1732         boolean visaRequired = visaRequiredCheckBox.isSelected();

1733         boolean visaTurnedIn = visaTurnedInCheckBox.isSelected();

1734         String visaNum = visaNumTF.getText();

1735         int visaExpiryDate = Integer.parseInt(visaExpiryDateTF.getText());

1736 

1737         VisaInformation b = new VisaInformation(fullName, passportNationality, passportNumber, passportExpiryDate,

1738             visaRequired, visaTurnedIn, visaNum, visaExpiryDate);

1739         visainformation.add(b);

1740 

1741         passportNationalityTF.setText("");

1742         passportNumberTF.setText("");

1743         passportExpiryDateTF.setText("");

1744         visaRequiredCheckBox.setSelected(false);

1745         visaTurnedInCheckBox.setSelected(false);

1746         visaNumTF.setText("");

1747         visaExpiryDateTF.setText("");

1748 

1749         fileSaveForVisaInformation(visainformation);

1750     }                                              

1751 

1752     private void passportExpiryDateTFActionPerformed(java.awt.event.ActionEvent evt) {                                                     

1753         // TODO add your handling code here:

1754     }                                                    

1755 

1756     private void passportExpiryDateSampleTFActionPerformed(java.awt.event.ActionEvent evt) {                                                           

1757         // TODO add your handling code here:

1758     }                                                          

1759 

1760     private void visaExpiryDataSampleTFActionPerformed(java.awt.event.ActionEvent evt) {                                                       

1761         // TODO add your handling code here:

1762     }                                                      

1763 

1764     private void gradeComboBoxActionPerformed(java.awt.event.ActionEvent evt) {                                              

1765         // TODO add your handling code here:

1766     }                                             

1767 

1768     private void yearTFActionPerformed(java.awt.event.ActionEvent evt) {                                       

1769         // TODO add your handling code here:

1770     }                                      

1771 

1772     private void firstNameTFActionPerformed(java.awt.event.ActionEvent evt) {                                            

1773         // TODO add your handling code here:

1774     }                                           

1775 

1776     private void studentInfoOKButtonActionPerformed(java.awt.event.ActionEvent evt) {                                                    

1777         // TODO add your handling code here:

1778     }                                                   

1779 

1780     private void studentInfoOKButtonMouseReleased(java.awt.event.MouseEvent evt) {                                                  

1781         // TODO add your handling code here:

1782         String lastName = lastNameTF.getText();

1783         String firstName = firstNameTF.getText();

1784         int idNum = Integer.parseInt(idNumTF.getText());

1785         String grade = gradeComboBox.getSelectedItem() + "";

1786         int year = Integer.parseInt(yearTF.getText());

1787 

1788         lastNameTF.setText("");

1789         firstNameTF.setText("");

1790         idNumTF.setText("");

1791         gradeComboBox.setSelectedItem(0);

1792         yearTF.setText("");

1793                 

1794      if(lastName.equals("") || firstName.equals("")) {

1795          JOptionPane.showMessageDialog(null, "Please type in all the information!", "Error", ERROR_MESSAGE);

1796      } else{

1797         Student a = new Student(lastName, firstName, idNum, grade, year);

1798         students.add(a);

1799         //add full name to the arrayList and populate it over the combo box.

1800         String fullName = firstName + " " + lastName;

1801         studentNameVisaComboBox.addItem(fullName);

1802         fileSaveForStudents(students);

1803       }   

1804      

1805 

1806     }                                                 

1807 

1808     private void lastNameTFActionPerformed(java.awt.event.ActionEvent evt) {                                           

1809         // TODO add your handling code here:

1810     }                                          

1811 

1812     private void editStudentButtonActionPerformed(java.awt.event.ActionEvent evt) {                                                  

1813         // TODO add your handling code here:

1814     }                                                 

1815 

1816     private void showVisaButtonMouseReleased(java.awt.event.MouseEvent evt) {                                             

1817         // TODO add your handling code here:

1818         for (int row = 0; row < visainformation.size(); row++) {

1819             editVisaTable.setValueAt(visainformation.get(row).getFullName(), row, 0);

1820             editVisaTable.setValueAt(visainformation.get(row).getPassportNationality(), row, 1);

1821             editVisaTable.setValueAt(visainformation.get(row).getPassportNumber(), row, 2);

1822             editVisaTable.setValueAt(visainformation.get(row).getPassportExpiryDate(), row, 3);

1823             editVisaTable.setValueAt(visainformation.get(row).getVisaRequired(), row, 4);

1824             editVisaTable.setValueAt(visainformation.get(row).getVisaTurnedIn(), row, 5);

1825             editVisaTable.setValueAt(visainformation.get(row).getVisaNumber(), row, 6);

1826             editVisaTable.setValueAt(visainformation.get(row).getVisaExpiryDate(), row, 7);

1827 

1828 

1829         }

1830     }                                            

1831 

1832     private void editVisaButtonMouseReleased(java.awt.event.MouseEvent evt) {                                             

1833         // TODO add your handling code here:

1834         editVisaInfo();

1835     }                                            

1836 

1837     private void saveVisaButtonMouseReleased(java.awt.event.MouseEvent evt) {                                             

1838         // TODO add your handling code here:

1839         JFrame f;

1840         f = new JFrame();

1841         int row = Integer.parseInt(rowToChooseVisaTF.getText()) - 1;

1842         if (JOptionPane.showConfirmDialog(f, "Are you sure?") == JOptionPane.YES_OPTION) {

1843             fileSaveForVisaInformation(visainformation);

1844         }

1845     }                                            

1846 

1847     private void removeVisaButtonMouseReleased(java.awt.event.MouseEvent evt) {                                               

1848         // TODO add your handling code here:

1849         JFrame f;

1850         f = new JFrame();

1851         int row = Integer.parseInt(rowToChooseVisaTF.getText()) - 1;

1852         if (JOptionPane.showConfirmDialog(f, "Are you sure?") == JOptionPane.YES_OPTION) {

1853             visainformation.remove(row);

1854         }

1855     }                                              

1856 

1857     private void editPassportNumberTFActionPerformed(java.awt.event.ActionEvent evt) {                                                     

1858         // TODO add your handling code here:

1859     }                                                    

1860 

1861     private void editPassportExpiryDateTFActionPerformed(java.awt.event.ActionEvent evt) {                                                         

1862         // TODO add your handling code here:

1863     }                                                        

1864 

1865     /**

1866      * @param args the command line arguments

1867      */

1868     public static void main(String args[]) {

1869         /* Set the Nimbus look and feel */

1870         //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">

1871         /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.

1872          * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 

1873          */

1874         try {

1875             for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {

1876                 if ("Nimbus".equals(info.getName())) {

1877                     javax.swing.UIManager.setLookAndFeel(info.getClassName());

1878                     break;

1879                 }

1880             }

1881         } catch (ClassNotFoundException ex) {

1882             java.util.logging.Logger.getLogger(MainGUIComponents.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);

1883         } catch (InstantiationException ex) {

1884             java.util.logging.Logger.getLogger(MainGUIComponents.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);

1885         } catch (IllegalAccessException ex) {

1886             java.util.logging.Logger.getLogger(MainGUIComponents.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);

1887         } catch (javax.swing.UnsupportedLookAndFeelException ex) {

1888             java.util.logging.Logger.getLogger(MainGUIComponents.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);

1889         }

1890         //</editor-fold>

1891         //</editor-fold>

1892         //</editor-fold>

1893         //</editor-fold>

1894 

1895         /* Create and display the form */

1896         java.awt.EventQueue.invokeLater(new Runnable() {

1897             public void run() {

1898                 new MainGUIComponents().setVisible(true);

1899             }

1900         });

1901     }

1902 

1903 


//************************************************************************************

// NOTE THAT ALL THE CODE WHICH IS HIGHLIGHTED GREY BLOCK IS AUTO-GENERATED

// FROM NETBEANS NOT BY THE PROGRAMMER.

//************************************************************************************




356     /**

 357      * This method is called from within the constructor to initialize the form.

 358      * WARNING: Do NOT modify this code. The content of this method is always

 359      * regenerated by the Form Editor.

 360      */

 361     @SuppressWarnings("unchecked")

 362     // <editor-fold defaultstate="collapsed" desc="Generated Code">                          

 363     private void initComponents() {

 364 

 365         jPopupMenu1 = new javax.swing.JPopupMenu();

 366         jScrollPane3 = new javax.swing.JScrollPane();

 367         jList1 = new javax.swing.JList<>();

 368         informationPane = new javax.swing.JTabbedPane();

 369         studentInformationPanel = new javax.swing.JPanel();

 370         studentNameLabel = new javax.swing.JLabel();

 371         lastNameTF = new javax.swing.JTextField();

 372         numIDLabel = new javax.swing.JLabel();

 373         idNumTF = new javax.swing.JTextField();

 374         studentInfoOKButton = new javax.swing.JButton();

 375         studentGradeLabel = new javax.swing.JLabel();

 376         firstNameTF = new javax.swing.JTextField();

 377         jLabel1 = new javax.swing.JLabel();

 378         jLabel2 = new javax.swing.JLabel();

 379         jLabel3 = new javax.swing.JLabel();

 380         yearTF = new javax.swing.JTextField();

 381         gradeComboBox = new javax.swing.JComboBox<>();

 382         passportInformationPanel = new javax.swing.JPanel();

 383         visaNumLabel = new javax.swing.JLabel();

 384         visaNumTF = new javax.swing.JTextField();

 385         visaExpiryDateLabel = new javax.swing.JLabel();

 386         visaExpiryDateTF = new javax.swing.JTextField();

 387         visaExpiryDataSampleTF = new javax.swing.JTextField();

 388         passportExpiryDateSampleTF = new javax.swing.JTextField();

 389         passportNationalityLabel = new javax.swing.JLabel();

 390         passportExpiryDateTF = new javax.swing.JTextField();

 391         passportExpiryDateLabel = new javax.swing.JLabel();

 392         passportNationalityTF = new javax.swing.JTextField();

 393         visaInfoOKButton = new javax.swing.JButton();

 394         studentNameVisaComboBox = new javax.swing.JComboBox<>();

 395         studentNameVisaLabel = new javax.swing.JLabel();

 396         visaRequiredCheckBox = new javax.swing.JCheckBox();

 397         jTextField1 = new javax.swing.JTextField();

 398         jLabel4 = new javax.swing.JLabel();

 399         visaTurnedInCheckBox = new javax.swing.JCheckBox();

 400         jLabel8 = new javax.swing.JLabel();

 401         passportNumberTF = new javax.swing.JTextField();

 402         jTextField2 = new javax.swing.JTextField();

 403         displayPanel = new javax.swing.JPanel();

 404         jScrollPane1 = new javax.swing.JScrollPane();

 405         displayTable = new javax.swing.JTable();

 406         refreshDisplayTableButton = new javax.swing.JButton();

 407         displaySortComboBox = new javax.swing.JComboBox<>();

 408         queryPanel = new javax.swing.JPanel();

 409         jScrollPane6 = new javax.swing.JScrollPane();

 410         displayQueryTable = new javax.swing.JTable();

 411         searchComboBox = new javax.swing.JComboBox<>();

 412         jLabel5 = new javax.swing.JLabel();

 413         jLabel6 = new javax.swing.JLabel();

 414         searchVisaNumTF = new javax.swing.JTextField();

 415         searchVisaExpiryDateTF = new javax.swing.JTextField();

 416         jLabel7 = new javax.swing.JLabel();

 417         searchVisaTurnedInTF = new javax.swing.JTextField();

 418         searchButton = new javax.swing.JButton();

 419         jLabel9 = new javax.swing.JLabel();

 420         searchPassportNationalityTF = new javax.swing.JTextField();

 421         jLabel10 = new javax.swing.JLabel();

 422         searchPassportNumberTF = new javax.swing.JTextField();

 423         jLabel11 = new javax.swing.JLabel();

 424         searchPassportExpiryDateTF = new javax.swing.JTextField();

 425         refreshQueryTableButton = new javax.swing.JButton();

 426         displayVisaSortComboBox = new javax.swing.JComboBox<>();

 427         imageInternalFrame = new javax.swing.JInternalFrame();

 428         jLabel12 = new javax.swing.JLabel();

 429         uploadImageButton = new javax.swing.JButton();

 430         refreshStudentListButton = new javax.swing.JButton();

 431         dataManagementPane = new javax.swing.JTabbedPane();

 432         jPanel3 = new javax.swing.JPanel();

 433         jScrollPane2 = new javax.swing.JScrollPane();

 434         editTStudentable = new javax.swing.JTable();

 435         editStudentButton = new javax.swing.JButton();

 436         saveStudentButton = new javax.swing.JButton();

 437         showStudentButton = new javax.swing.JButton();

 438         jLabel13 = new javax.swing.JLabel();

 439         editLastNameTF = new javax.swing.JTextField();

 440         editFirstNameTF = new javax.swing.JTextField();

 441         editIdNumTF = new javax.swing.JTextField();

 442         editYearTF = new javax.swing.JTextField();

 443         rowToChooseStudentTF = new javax.swing.JTextField();

 444         jLabel14 = new javax.swing.JLabel();

 445         editGradeComboBox = new javax.swing.JComboBox<>();

 446         removeStudentButton = new javax.swing.JButton();

 447         jPanel1 = new javax.swing.JPanel();

 448         jScrollPane7 = new javax.swing.JScrollPane();

 449         editVisaTable = new javax.swing.JTable();

 450         editVisaExpiryDateTF = new javax.swing.JTextField();

 451         editPassportNumberTF = new javax.swing.JTextField();

 452         editPassportExpiryDateTF = new javax.swing.JTextField();

 453         editPassportNationalityTF = new javax.swing.JTextField();

 454         editVisaNumberTF = new javax.swing.JTextField();

 455         editVisaRequiredCheckBox = new javax.swing.JCheckBox();

 456         editVisaTurnedInCheckBox = new javax.swing.JCheckBox();

 457         showVisaButton = new javax.swing.JButton();

 458         editVisaButton = new javax.swing.JButton();

 459         saveVisaButton = new javax.swing.JButton();

 460         removeVisaButton = new javax.swing.JButton();

 461         jLabel15 = new javax.swing.JLabel();

 462         rowToChooseVisaTF = new javax.swing.JTextField();

 463         jLabel16 = new javax.swing.JLabel();

 464         jLabel17 = new javax.swing.JLabel();

 465         jLabel18 = new javax.swing.JLabel();

 466         jLabel20 = new javax.swing.JLabel();

 467         jLabel23 = new javax.swing.JLabel();

 468         menuBar = new javax.swing.JMenuBar();

 469         fileMenu = new javax.swing.JMenu();

 470         openMenuItem = new javax.swing.JMenuItem();

 471         saveMenuItem = new javax.swing.JMenuItem();

 472         saveAsMenuItem = new javax.swing.JMenuItem();

 473         exitMenuItem = new javax.swing.JMenuItem();

 474         editMenu = new javax.swing.JMenu();

 475         cutMenuItem = new javax.swing.JMenuItem();

 476         copyMenuItem = new javax.swing.JMenuItem();

 477         pasteMenuItem = new javax.swing.JMenuItem();

 478         deleteMenuItem = new javax.swing.JMenuItem();

 479         helpMenu = new javax.swing.JMenu();

 480         contentsMenuItem = new javax.swing.JMenuItem();

 481         aboutMenuItem = new javax.swing.JMenuItem();

 482 

 483         jList1.setModel(new javax.swing.AbstractListModel<String>() {

 484             String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };

 485             public int getSize() { return strings.length; }

 486             public String getElementAt(int i) { return strings[i]; }

 487         });

 488         jScrollPane3.setViewportView(jList1);

 489 

 490         setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

 491 

 492         studentNameLabel.setText("Student Name");

 493 

 494         lastNameTF.addActionListener(new java.awt.event.ActionListener() {

 495             public void actionPerformed(java.awt.event.ActionEvent evt) {

 496                 lastNameTFActionPerformed(evt);

 497             }

 498         });

 499 

 500         numIDLabel.setText("ID Number");

 501 

 502         studentInfoOKButton.setText("Add");

 503         studentInfoOKButton.addMouseListener(new java.awt.event.MouseAdapter() {

 504             public void mouseReleased(java.awt.event.MouseEvent evt) {

 505                 studentInfoOKButtonMouseReleased(evt);

 506             }

 507         });

 508         studentInfoOKButton.addActionListener(new java.awt.event.ActionListener() {

 509             public void actionPerformed(java.awt.event.ActionEvent evt) {

 510                 studentInfoOKButtonActionPerformed(evt);

 511             }

 512         });

 513 

 514         studentGradeLabel.setText("Grade");

 515 

 516         firstNameTF.addActionListener(new java.awt.event.ActionListener() {

 517             public void actionPerformed(java.awt.event.ActionEvent evt) {

 518                 firstNameTFActionPerformed(evt);

 519             }

 520         });

 521 

 522         jLabel1.setText("LastName");

 523 

 524         jLabel2.setText("FirstName");

 525 

 526         jLabel3.setText("Year");

 527 

 528         yearTF.addActionListener(new java.awt.event.ActionListener() {

 529             public void actionPerformed(java.awt.event.ActionEvent evt) {

 530                 yearTFActionPerformed(evt);

 531             }

 532         });

 533 

 534         gradeComboBox.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "9", "10", "11", "12", " " }));

 535         gradeComboBox.addActionListener(new java.awt.event.ActionListener() {

 536             public void actionPerformed(java.awt.event.ActionEvent evt) {

 537                 gradeComboBoxActionPerformed(evt);

 538             }

 539         });

 540 

 541         javax.swing.GroupLayout studentInformationPanelLayout = new javax.swing.GroupLayout(studentInformationPanel);

 542         studentInformationPanel.setLayout(studentInformationPanelLayout);

 543         studentInformationPanelLayout.setHorizontalGroup(

 544             studentInformationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

 545             .addGroup(studentInformationPanelLayout.createSequentialGroup()

 546                 .addGroup(studentInformationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

 547                     .addGroup(studentInformationPanelLayout.createSequentialGroup()

 548                         .addGap(103, 103, 103)

 549                         .addGroup(studentInformationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

 550                             .addComponent(studentNameLabel)

 551                             .addComponent(numIDLabel)

 552                             .addComponent(studentGradeLabel)

 553                             .addComponent(jLabel3))

 554                         .addGroup(studentInformationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

 555                             .addGroup(studentInformationPanelLayout.createSequentialGroup()

 556                                 .addGap(34, 34, 34)

 557                                 .addComponent(jLabel1)

 558                                 .addGap(35, 35, 35)

 559                                 .addComponent(jLabel2))

 560                             .addGroup(studentInformationPanelLayout.createSequentialGroup()

 561                                 .addGap(25, 25, 25)

 562                                 .addGroup(studentInformationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

 563                                     .addComponent(gradeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)

 564                                     .addGroup(studentInformationPanelLayout.createSequentialGroup()

 565                                         .addGroup(studentInformationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)

 566                                             .addComponent(yearTF, javax.swing.GroupLayout.DEFAULT_SIZE, 79, Short.MAX_VALUE)

 567                                             .addComponent(lastNameTF)

 568                                             .addComponent(idNumTF))

 569                                         .addGap(18, 18, 18)

 570                                         .addComponent(firstNameTF, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE))))))

 571                     .addGroup(studentInformationPanelLayout.createSequentialGroup()

 572                         .addGap(410, 410, 410)

 573                         .addComponent(studentInfoOKButton)))

 574                 .addContainerGap(349, Short.MAX_VALUE))

 575         );

 576         studentInformationPanelLayout.setVerticalGroup(

 577             studentInformationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

 578             .addGroup(studentInformationPanelLayout.createSequentialGroup()

 579                 .addGap(27, 27, 27)

 580                 .addGroup(studentInformationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)

 581                     .addComponent(jLabel1)

 582                     .addComponent(jLabel2))

 583                 .addGap(18, 18, 18)

 584                 .addGroup(studentInformationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)

 585                     .addComponent(studentNameLabel)

 586                     .addComponent(lastNameTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)

 587                     .addComponent(firstNameTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))

 588                 .addGap(45, 45, 45)

 589                 .addGroup(studentInformationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)

 590                     .addComponent(numIDLabel)

 591                     .addComponent(idNumTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))

 592                 .addGap(36, 36, 36)

 593                 .addGroup(studentInformationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)

 594                     .addComponent(studentGradeLabel)

 595                     .addComponent(gradeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))

 596                 .addGap(30, 30, 30)

 597                 .addGroup(studentInformationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)

 598                     .addComponent(jLabel3)

 599                     .addComponent(yearTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))

 600                 .addGap(16, 16, 16)

 601                 .addComponent(studentInfoOKButton)

 602                 .addContainerGap(340, Short.MAX_VALUE))

 603         );

 604 

 605         informationPane.addTab("Student Information", studentInformationPanel);

 606 

 607         visaNumLabel.setText("VISA Number");

 608 

 609         visaExpiryDateLabel.setText("VISA Expiry Date");

 610 

 611         visaExpiryDataSampleTF.setText("Year Month Day");

 612         visaExpiryDataSampleTF.addActionListener(new java.awt.event.ActionListener() {

 613             public void actionPerformed(java.awt.event.ActionEvent evt) {

 614                 visaExpiryDataSampleTFActionPerformed(evt);

 615             }

 616         });

 617 

 618         passportExpiryDateSampleTF.setText("Year Month Day");

 619         passportExpiryDateSampleTF.addActionListener(new java.awt.event.ActionListener() {

 620             public void actionPerformed(java.awt.event.ActionEvent evt) {

 621                 passportExpiryDateSampleTFActionPerformed(evt);

 622             }

 623         });

 624 

 625         passportNationalityLabel.setText("Passport Nationality");

 626 

 627         passportExpiryDateTF.addActionListener(new java.awt.event.ActionListener() {

 628             public void actionPerformed(java.awt.event.ActionEvent evt) {

 629                 passportExpiryDateTFActionPerformed(evt);

 630             }

 631         });

 632 

 633         passportExpiryDateLabel.setText("Passport Expiry Date");

 634 

 635         visaInfoOKButton.setText("Add");

 636         visaInfoOKButton.addMouseListener(new java.awt.event.MouseAdapter() {

 637             public void mouseReleased(java.awt.event.MouseEvent evt) {

 638                 visaInfoOKButtonMouseReleased(evt);

 639             }

 640         });

 641         visaInfoOKButton.addActionListener(new java.awt.event.ActionListener() {

 642             public void actionPerformed(java.awt.event.ActionEvent evt) {

 643                 visaInfoOKButtonActionPerformed(evt);

 644             }

 645         });

 646 

 647         studentNameVisaComboBox.addMouseListener(new java.awt.event.MouseAdapter() {

 648             public void mouseClicked(java.awt.event.MouseEvent evt) {

 649                 studentNameVisaComboBoxMouseClicked(evt);

 650             }

 651         });

 652         studentNameVisaComboBox.addActionListener(new java.awt.event.ActionListener() {

 653             public void actionPerformed(java.awt.event.ActionEvent evt) {

 654                 studentNameVisaComboBoxActionPerformed(evt);

 655             }

 656         });

 657 

 658         studentNameVisaLabel.setText("Name");

 659 

 660         visaRequiredCheckBox.setText("VISA Required?");

 661 

 662         jTextField1.setText("EX) 20180217");

 663         jTextField1.addActionListener(new java.awt.event.ActionListener() {

 664             public void actionPerformed(java.awt.event.ActionEvent evt) {

 665                 jTextField1ActionPerformed(evt);

 666             }

 667         });

 668 

 669         jLabel4.setText("VISA Status");

 670 

 671         visaTurnedInCheckBox.setText("Visa Turned In?");

 672         visaTurnedInCheckBox.addActionListener(new java.awt.event.ActionListener() {

 673             public void actionPerformed(java.awt.event.ActionEvent evt) {

 674                 visaTurnedInCheckBoxActionPerformed(evt);

 675             }

 676         });

 677 

 678         jLabel8.setText("Passport Number");

 679 

 680         jTextField2.setText("EX) 20180217");

 681 

 682         javax.swing.GroupLayout passportInformationPanelLayout = new javax.swing.GroupLayout(passportInformationPanel);

 683         passportInformationPanel.setLayout(passportInformationPanelLayout);

 684         passportInformationPanelLayout.setHorizontalGroup(

 685             passportInformationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

 686             .addGroup(passportInformationPanelLayout.createSequentialGroup()

 687                 .addGap(49, 49, 49)

 688                 .addGroup(passportInformationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

 689                     .addGroup(passportInformationPanelLayout.createSequentialGroup()

 690                         .addComponent(studentNameVisaLabel)

 691                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)

 692                         .addComponent(studentNameVisaComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))

 693                     .addGroup(passportInformationPanelLayout.createSequentialGroup()

 694                         .addComponent(passportNationalityLabel)

 695                         .addGap(18, 18, 18)

 696                         .addComponent(passportNationalityTF, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE))

 697                     .addGroup(passportInformationPanelLayout.createSequentialGroup()

 698                         .addGroup(passportInformationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)

 699                             .addGroup(javax.swing.GroupLayout.Alignment.LEADING, passportInformationPanelLayout.createSequentialGroup()

 700                                 .addComponent(jLabel4)

 701                                 .addGap(62, 62, 62)

 702                                 .addGroup(passportInformationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

 703                                     .addComponent(visaRequiredCheckBox)

 704                                     .addComponent(visaTurnedInCheckBox)))

 705                             .addGroup(javax.swing.GroupLayout.Alignment.LEADING, passportInformationPanelLayout.createSequentialGroup()

 706                                 .addGroup(passportInformationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

 707                                     .addGroup(passportInformationPanelLayout.createSequentialGroup()

 708                                         .addComponent(passportExpiryDateLabel)

 709                                         .addGap(18, 18, 18))

 710                                     .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, passportInformationPanelLayout.createSequentialGroup()

 711                                         .addComponent(jLabel8)

 712                                         .addGap(40, 40, 40)))

 713                                 .addGroup(passportInformationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)

 714                                     .addComponent(passportExpiryDateTF, javax.swing.GroupLayout.DEFAULT_SIZE, 83, Short.MAX_VALUE)

 715                                     .addComponent(passportNumberTF))

 716                                 .addGap(28, 28, 28)

 717                                 .addComponent(passportExpiryDateSampleTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))

 718                             .addGroup(javax.swing.GroupLayout.Alignment.LEADING, passportInformationPanelLayout.createSequentialGroup()

 719                                 .addGroup(passportInformationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)

 720                                     .addGroup(javax.swing.GroupLayout.Alignment.LEADING, passportInformationPanelLayout.createSequentialGroup()

 721                                         .addComponent(visaNumLabel)

 722                                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)

 723                                         .addComponent(visaNumTF, javax.swing.GroupLayout.PREFERRED_SIZE, 102, javax.swing.GroupLayout.PREFERRED_SIZE))

 724                                     .addGroup(javax.swing.GroupLayout.Alignment.LEADING, passportInformationPanelLayout.createSequentialGroup()

 725                                         .addComponent(visaExpiryDateLabel)

 726                                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)

 727                                         .addComponent(visaExpiryDateTF, javax.swing.GroupLayout.PREFERRED_SIZE, 102, javax.swing.GroupLayout.PREFERRED_SIZE)))

 728                                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 41, Short.MAX_VALUE)

 729                                 .addComponent(visaExpiryDataSampleTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))

 730                         .addGap(47, 47, 47)

 731                         .addGroup(passportInformationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

 732                             .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)

 733                             .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))

 734                 .addContainerGap(273, Short.MAX_VALUE))

 735             .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, passportInformationPanelLayout.createSequentialGroup()

 736                 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)

 737                 .addComponent(visaInfoOKButton)

 738                 .addGap(175, 175, 175))

 739         );

 740         passportInformationPanelLayout.setVerticalGroup(

 741             passportInformationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

 742             .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, passportInformationPanelLayout.createSequentialGroup()

 743                 .addGap(40, 40, 40)

 744                 .addGroup(passportInformationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)

 745                     .addComponent(studentNameVisaLabel)

 746                     .addComponent(studentNameVisaComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))

 747                 .addGap(25, 25, 25)

 748                 .addGroup(passportInformationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)

 749                     .addComponent(passportNationalityLabel)

 750                     .addComponent(passportNationalityTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))

 751                 .addGap(15, 15, 15)

 752                 .addGroup(passportInformationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)

 753                     .addComponent(jLabel8)

 754                     .addComponent(passportNumberTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))

 755                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)

 756                 .addGroup(passportInformationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)

 757                     .addComponent(passportExpiryDateLabel)

 758                     .addComponent(passportExpiryDateSampleTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)

 759                     .addComponent(passportExpiryDateTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)

 760                     .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))

 761                 .addGroup(passportInformationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

 762                     .addGroup(passportInformationPanelLayout.createSequentialGroup()

 763                         .addGap(26, 26, 26)

 764                         .addComponent(visaRequiredCheckBox)

 765                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)

 766                         .addComponent(visaTurnedInCheckBox))

 767                     .addGroup(passportInformationPanelLayout.createSequentialGroup()

 768                         .addGap(45, 45, 45)

 769                         .addComponent(jLabel4)))

 770                 .addGap(37, 37, 37)

 771                 .addGroup(passportInformationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)

 772                     .addComponent(visaNumLabel)

 773                     .addComponent(visaNumTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))

 774                 .addGap(20, 20, 20)

 775                 .addGroup(passportInformationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)

 776                     .addComponent(visaExpiryDateLabel)

 777                     .addComponent(visaExpiryDateTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)

 778                     .addComponent(visaExpiryDataSampleTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)

 779                     .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))

 780                 .addGap(43, 43, 43)

 781                 .addComponent(visaInfoOKButton)

 782                 .addContainerGap(206, Short.MAX_VALUE))

 783         );

 784 

 785         informationPane.addTab("Visa Information", passportInformationPanel);

 786 

 787         displayTable.setModel(new javax.swing.table.DefaultTableModel(

 788             new Object [][] {

 789                 {null, null, null, null, null, null, null},

 790                 {null, null, null, null, null, null, null},

 791                 {null, null, null, null, null, null, null},

 792                 {null, null, null, null, null, null, null},

 793                 {null, null, null, null, null, null, null},

 794                 {null, null, null, null, null, null, null},

 795                 {null, null, null, null, null, null, null},

 796                 {null, null, null, null, null, null, null},

 797                 {null, null, null, null, null, null, null},

 798                 {null, null, null, null, null, null, null},

 799                 {null, null, null, null, null, null, null},

 800                 {null, null, null, null, null, null, null},

 801                 {null, null, null, null, null, null, null},

 802                 {null, null, null, null, null, null, null},

 803                 {null, null, null, null, null, null, null},

 804                 {null, null, null, null, null, null, null},

 805                 {null, null, null, null, null, null, null},

 806                 {null, null, null, null, null, null, null},

 807                 {null, null, null, null, null, null, null},

 808                 {null, null, null, null, null, null, null}

 809             },

 810             new String [] {

 811                 "Last Name", "First Name", "ID Number", "Grade", "Year", "Visa Required", "Visa Turned In"

 812             }

 813         ) {

 814             boolean[] canEdit = new boolean [] {

 815                 true, false, false, false, false, false, false

 816             };

 817 

 818             public boolean isCellEditable(int rowIndex, int columnIndex) {

 819                 return canEdit [columnIndex];

 820             }

 821         });

 822         displayTable.setGridColor(new java.awt.Color(0, 0, 0));

 823         displayTable.setShowGrid(true);

 824         jScrollPane1.setViewportView(displayTable);

 825         if (displayTable.getColumnModel().getColumnCount() > 0) {

 826             displayTable.getColumnModel().getColumn(2).setResizable(false);

 827             displayTable.getColumnModel().getColumn(3).setResizable(false);

 828         }

 829 

 830         refreshDisplayTableButton.setText("Refresh ");

 831         refreshDisplayTableButton.addMouseListener(new java.awt.event.MouseAdapter() {

 832             public void mouseReleased(java.awt.event.MouseEvent evt) {

 833                 refreshDisplayTableButtonMouseReleased(evt);

 834             }

 835         });

 836         refreshDisplayTableButton.addActionListener(new java.awt.event.ActionListener() {

 837             public void actionPerformed(java.awt.event.ActionEvent evt) {

 838                 refreshDisplayTableButtonActionPerformed(evt);

 839             }

 840         });

 841 

 842         displaySortComboBox.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "SelectToSort", "LastNameAscending", "LastNameDescending", "FirstNameAscending", "FirstNameDescending", "GradeAscending", "GradeDescending", "YearAscending", "YearDescending", "VisaRequiredYes", "VisaRequiredNo", "VisaTurnedInYes", "VisaTurnedInNo", " " }));

 843         displaySortComboBox.addMouseListener(new java.awt.event.MouseAdapter() {

 844             public void mouseReleased(java.awt.event.MouseEvent evt) {

 845                 displaySortComboBoxMouseReleased(evt);

 846             }

 847         });

 848         displaySortComboBox.addActionListener(new java.awt.event.ActionListener() {

 849             public void actionPerformed(java.awt.event.ActionEvent evt) {

 850                 displaySortComboBoxActionPerformed(evt);

 851             }

 852         });

 853 

 854         javax.swing.GroupLayout displayPanelLayout = new javax.swing.GroupLayout(displayPanel);

 855         displayPanel.setLayout(displayPanelLayout);

 856         displayPanelLayout.setHorizontalGroup(

 857             displayPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

 858             .addGroup(displayPanelLayout.createSequentialGroup()

 859                 .addGap(23, 23, 23)

 860                 .addGroup(displayPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

 861                     .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 758, javax.swing.GroupLayout.PREFERRED_SIZE)

 862                     .addGroup(displayPanelLayout.createSequentialGroup()

 863                         .addComponent(displaySortComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)

 864                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)

 865                         .addComponent(refreshDisplayTableButton)))

 866                 .addContainerGap(53, Short.MAX_VALUE))

 867         );

 868         displayPanelLayout.setVerticalGroup(

 869             displayPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

 870             .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, displayPanelLayout.createSequentialGroup()

 871                 .addGap(29, 29, 29)

 872                 .addGroup(displayPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)

 873                     .addComponent(refreshDisplayTableButton)

 874                     .addComponent(displaySortComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))

 875                 .addGap(28, 28, 28)

 876                 .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 325, javax.swing.GroupLayout.PREFERRED_SIZE)

 877                 .addContainerGap(251, Short.MAX_VALUE))

 878         );

 879 

 880         informationPane.addTab("Display", displayPanel);

 881 

 882         displayQueryTable.setModel(new javax.swing.table.DefaultTableModel(

 883             new Object [][] {

 884                 {null, null, null},

 885                 {null, null, null},

 886                 {null, null, null},

 887                 {null, null, null},

 888                 {null, null, null},

 889                 {null, null, null},

 890                 {null, null, null},

 891                 {null, null, null},

 892                 {null, null, null},

 893                 {null, null, null},

 894                 {null, null, null},

 895                 {null, null, null},

 896                 {null, null, null},

 897                 {null, null, null},

 898                 {null, null, null},

 899                 {null, null, null},

 900                 {null, null, null},

 901                 {null, null, null},

 902                 {null, null, null},

 903                 {null, null, null}

 904             },

 905             new String [] {

 906                 "Full Name", "Passport Expiry Date", "Visa Expiry Date"

 907             }

 908         ) {

 909             boolean[] canEdit = new boolean [] {

 910                 false, true, true

 911             };

 912 

 913             public boolean isCellEditable(int rowIndex, int columnIndex) {

 914                 return canEdit [columnIndex];

 915             }

 916         });

 917         displayQueryTable.setGridColor(new java.awt.Color(51, 51, 51));

 918         displayQueryTable.setShowGrid(true);

 919         jScrollPane6.setViewportView(displayQueryTable);

 920 

 921         jLabel5.setText("Visa Number");

 922 

 923         jLabel6.setText("Visa Expiry Date");

 924 

 925         searchVisaExpiryDateTF.addActionListener(new java.awt.event.ActionListener() {

 926             public void actionPerformed(java.awt.event.ActionEvent evt) {

 927                 searchVisaExpiryDateTFActionPerformed(evt);

 928             }

 929         });

 930 

 931         jLabel7.setText("VisaTurnedIn?");

 932 

 933         searchVisaTurnedInTF.addActionListener(new java.awt.event.ActionListener() {

 934             public void actionPerformed(java.awt.event.ActionEvent evt) {

 935                 searchVisaTurnedInTFActionPerformed(evt);

 936             }

 937         });

 938 

 939         searchButton.setText("Search");

 940         searchButton.addMouseListener(new java.awt.event.MouseAdapter() {

 941             public void mouseReleased(java.awt.event.MouseEvent evt) {

 942                 searchButtonMouseReleased(evt);

 943             }

 944         });

 945         searchButton.addActionListener(new java.awt.event.ActionListener() {

 946             public void actionPerformed(java.awt.event.ActionEvent evt) {

 947                 searchButtonActionPerformed(evt);

 948             }

 949         });

 950 

 951         jLabel9.setText("Passport Nationality");

 952 

 953         jLabel10.setText("Passport Number");

 954 

 955         searchPassportNumberTF.addActionListener(new java.awt.event.ActionListener() {

 956             public void actionPerformed(java.awt.event.ActionEvent evt) {

 957                 searchPassportNumberTFActionPerformed(evt);

 958             }

 959         });

 960 

 961         jLabel11.setText("Passport Expiry Date");

 962 

 963         refreshQueryTableButton.setText("Refresh Table");

 964         refreshQueryTableButton.addMouseListener(new java.awt.event.MouseAdapter() {

 965             public void mouseReleased(java.awt.event.MouseEvent evt) {

 966                 refreshQueryTableButtonMouseReleased(evt);

 967             }

 968         });

 969 

 970         displayVisaSortComboBox.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Select to sort", "PassportExpiryDateAscending", "PassportExpiryDateDescending", "VisaExpiryDateAscending", "VisaExpiryDateDescending", " " }));

 971 

 972         imageInternalFrame.setVisible(true);

 973 

 974         javax.swing.GroupLayout imageInternalFrameLayout = new javax.swing.GroupLayout(imageInternalFrame.getContentPane());

 975         imageInternalFrame.getContentPane().setLayout(imageInternalFrameLayout);

 976         imageInternalFrameLayout.setHorizontalGroup(

 977             imageInternalFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

 978             .addComponent(jLabel12, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)

 979         );

 980         imageInternalFrameLayout.setVerticalGroup(

 981             imageInternalFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

 982             .addComponent(jLabel12, javax.swing.GroupLayout.DEFAULT_SIZE, 356, Short.MAX_VALUE)

 983         );

 984 

 985         uploadImageButton.setText("Upload");

 986         uploadImageButton.addMouseListener(new java.awt.event.MouseAdapter() {

 987             public void mouseReleased(java.awt.event.MouseEvent evt) {

 988                 uploadImageButtonMouseReleased(evt);

 989             }

 990         });

 991 

 992         refreshStudentListButton.setText("Refresh");

 993         refreshStudentListButton.addMouseListener(new java.awt.event.MouseAdapter() {

 994             public void mouseReleased(java.awt.event.MouseEvent evt) {

 995                 refreshStudentListButtonMouseReleased(evt);

 996             }

 997         });

 998 

 999         javax.swing.GroupLayout queryPanelLayout = new javax.swing.GroupLayout(queryPanel);

1000         queryPanel.setLayout(queryPanelLayout);

1001         queryPanelLayout.setHorizontalGroup(

1002             queryPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

1003             .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, queryPanelLayout.createSequentialGroup()

1004                 .addGroup(queryPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)

1005                     .addGroup(javax.swing.GroupLayout.Alignment.LEADING, queryPanelLayout.createSequentialGroup()

1006                         .addContainerGap()

1007                         .addComponent(imageInternalFrame))

1008                     .addGroup(queryPanelLayout.createSequentialGroup()

1009                         .addGroup(queryPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

1010                             .addGroup(queryPanelLayout.createSequentialGroup()

1011                                 .addGap(14, 14, 14)

1012                                 .addComponent(searchComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)

1013                                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)

1014                                 .addComponent(refreshStudentListButton)

1015                                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)

1016                                 .addComponent(searchButton)

1017                                 .addGap(0, 0, Short.MAX_VALUE))

1018                             .addGroup(queryPanelLayout.createSequentialGroup()

1019                                 .addGap(19, 19, 19)

1020                                 .addGroup(queryPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

1021                                     .addComponent(jLabel5)

1022                                     .addComponent(jLabel6)

1023                                     .addComponent(jLabel7)

1024                                     .addComponent(jLabel9)

1025                                     .addComponent(jLabel11)

1026                                     .addComponent(jLabel10))

1027                                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)

1028                                 .addGroup(queryPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

1029                                     .addComponent(searchVisaExpiryDateTF, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE)

1030                                     .addComponent(searchVisaTurnedInTF, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE)

1031                                     .addComponent(searchPassportNationalityTF, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE)

1032                                     .addComponent(searchPassportExpiryDateTF, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE)

1033                                     .addComponent(searchVisaNumTF, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE)

1034                                     .addComponent(searchPassportNumberTF, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE))

1035                                 .addGap(36, 36, 36)))

1036                         .addGroup(queryPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)

1037                             .addGroup(queryPanelLayout.createSequentialGroup()

1038                                 .addComponent(uploadImageButton)

1039                                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)

1040                                 .addComponent(displayVisaSortComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)

1041                                 .addGap(18, 18, 18)

1042                                 .addComponent(refreshQueryTableButton))

1043                             .addComponent(jScrollPane6))))

1044                 .addContainerGap())

1045         );

1046         queryPanelLayout.setVerticalGroup(

1047             queryPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

1048             .addGroup(queryPanelLayout.createSequentialGroup()

1049                 .addContainerGap()

1050                 .addGroup(queryPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

1051                     .addGroup(queryPanelLayout.createSequentialGroup()

1052                         .addGap(42, 42, 42)

1053                         .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE))

1054                     .addGroup(queryPanelLayout.createSequentialGroup()

1055                         .addGroup(queryPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)

1056                             .addComponent(searchComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)

1057                             .addComponent(refreshStudentListButton)

1058                             .addComponent(searchButton)

1059                             .addComponent(uploadImageButton)

1060                             .addComponent(displayVisaSortComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)

1061                             .addComponent(refreshQueryTableButton))

1062                         .addGap(17, 17, 17)

1063                         .addGroup(queryPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)

1064                             .addComponent(searchPassportNationalityTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)

1065                             .addComponent(jLabel9))

1066                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)

1067                         .addGroup(queryPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)

1068                             .addComponent(jLabel10)

1069                             .addComponent(searchPassportNumberTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))

1070                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)

1071                         .addGroup(queryPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)

1072                             .addComponent(jLabel11)

1073                             .addComponent(searchPassportExpiryDateTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))

1074                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)

1075                         .addGroup(queryPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)

1076                             .addComponent(jLabel5)

1077                             .addComponent(searchVisaNumTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))

1078                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)

1079                         .addGroup(queryPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)

1080                             .addComponent(jLabel6)

1081                             .addComponent(searchVisaExpiryDateTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))

1082                         .addGap(5, 5, 5)

1083                         .addGroup(queryPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)

1084                             .addComponent(jLabel7)

1085                             .addComponent(searchVisaTurnedInTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))

1086                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)

1087                 .addComponent(imageInternalFrame, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)

1088                 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))

1089         );

1090 

1091         informationPane.addTab("Query", queryPanel);

1092 

1093         editTStudentable.setModel(new javax.swing.table.DefaultTableModel(

1094             new Object [][] {

1095                 {null, null, null, null, null},

1096                 {null, null, null, null, null},

1097                 {null, null, null, null, null},

1098                 {null, null, null, null, null},

1099                 {null, null, null, null, null},

1100                 {null, null, null, null, null},

1101                 {null, null, null, null, null},

1102                 {null, null, null, null, null},

1103                 {null, null, null, null, null},

1104                 {null, null, null, null, null},

1105                 {null, null, null, null, null},

1106                 {null, null, null, null, null},

1107                 {null, null, null, null, null},

1108                 {null, null, null, null, null},

1109                 {null, null, null, null, null},

1110                 {null, null, null, null, null},

1111                 {null, null, null, null, null},

1112                 {null, null, null, null, null},

1113                 {null, null, null, null, null},

1114                 {null, null, null, null, null}

1115             },

1116             new String [] {

1117                 "Last Name", "First Name", "ID Number", "Grade", "Year"

1118             }

1119         ));

1120         editTStudentable.setGridColor(new java.awt.Color(0, 0, 0));

1121         editTStudentable.setShowGrid(true);

1122         jScrollPane2.setViewportView(editTStudentable);

1123 

1124         editStudentButton.setText("edit");

1125         editStudentButton.addMouseListener(new java.awt.event.MouseAdapter() {

1126             public void mouseReleased(java.awt.event.MouseEvent evt) {

1127                 editStudentButtonMouseReleased(evt);

1128             }

1129         });

1130         editStudentButton.addActionListener(new java.awt.event.ActionListener() {

1131             public void actionPerformed(java.awt.event.ActionEvent evt) {

1132                 editStudentButtonActionPerformed(evt);

1133             }

1134         });

1135 

1136         saveStudentButton.setText("save");

1137         saveStudentButton.addMouseListener(new java.awt.event.MouseAdapter() {

1138             public void mouseReleased(java.awt.event.MouseEvent evt) {

1139                 saveStudentButtonMouseReleased(evt);

1140             }

1141         });

1142 

1143         showStudentButton.setText("show");

1144         showStudentButton.addMouseListener(new java.awt.event.MouseAdapter() {

1145             public void mouseReleased(java.awt.event.MouseEvent evt) {

1146                 showStudentButtonMouseReleased(evt);

1147             }

1148         });

1149 

1150         jLabel13.setText("Information");

1151 

1152         editYearTF.addActionListener(new java.awt.event.ActionListener() {

1153             public void actionPerformed(java.awt.event.ActionEvent evt) {

1154                 editYearTFActionPerformed(evt);

1155             }

1156         });

1157 

1158         jLabel14.setText("Row Num");

1159 

1160         editGradeComboBox.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "9", "10", "11", "12", " " }));

1161 

1162         removeStudentButton.setText("remove");

1163         removeStudentButton.addMouseListener(new java.awt.event.MouseAdapter() {

1164             public void mouseReleased(java.awt.event.MouseEvent evt) {

1165                 removeStudentButtonMouseReleased(evt);

1166             }

1167         });

1168 

1169         javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);

1170         jPanel3.setLayout(jPanel3Layout);

1171         jPanel3Layout.setHorizontalGroup(

1172             jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

1173             .addGroup(jPanel3Layout.createSequentialGroup()

1174                 .addGap(132, 132, 132)

1175                 .addComponent(editLastNameTF, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE)

1176                 .addGap(46, 46, 46)

1177                 .addComponent(editFirstNameTF, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)

1178                 .addGap(43, 43, 43)

1179                 .addComponent(editIdNumTF, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE)

1180                 .addGap(49, 49, 49)

1181                 .addComponent(editGradeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)

1182                 .addGap(46, 46, 46)

1183                 .addComponent(editYearTF, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)

1184                 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))

1185             .addGroup(jPanel3Layout.createSequentialGroup()

1186                 .addContainerGap()

1187                 .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

1188                     .addGroup(jPanel3Layout.createSequentialGroup()

1189                         .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)

1190                             .addComponent(showStudentButton)

1191                             .addComponent(jLabel14))

1192                         .addGap(18, 18, 18)

1193                         .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

1194                             .addGroup(jPanel3Layout.createSequentialGroup()

1195                                 .addComponent(editStudentButton)

1196                                 .addGap(12, 12, 12)

1197                                 .addComponent(removeStudentButton)

1198                                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)

1199                                 .addComponent(saveStudentButton))

1200                             .addComponent(rowToChooseStudentTF, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE))

1201                         .addGap(0, 0, Short.MAX_VALUE))

1202                     .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()

1203                         .addGap(0, 31, Short.MAX_VALUE)

1204                         .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

1205                             .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()

1206                                 .addComponent(jLabel13)

1207                                 .addGap(702, 702, 702))

1208                             .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()

1209                                 .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 609, javax.swing.GroupLayout.PREFERRED_SIZE)

1210                                 .addGap(88, 88, 88))))))

1211         );

1212         jPanel3Layout.setVerticalGroup(

1213             jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

1214             .addGroup(jPanel3Layout.createSequentialGroup()

1215                 .addContainerGap()

1216                 .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)

1217                     .addComponent(showStudentButton)

1218                     .addComponent(editStudentButton)

1219                     .addComponent(saveStudentButton)

1220                     .addComponent(removeStudentButton))

1221                 .addGap(18, 18, 18)

1222                 .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)

1223                     .addComponent(jLabel14)

1224                     .addComponent(rowToChooseStudentTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))

1225                 .addGap(35, 35, 35)

1226                 .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 315, javax.swing.GroupLayout.PREFERRED_SIZE)

1227                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)

1228                 .addComponent(jLabel13)

1229                 .addGap(7, 7, 7)

1230                 .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)

1231                     .addComponent(editLastNameTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)

1232                     .addComponent(editFirstNameTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)

1233                     .addComponent(editIdNumTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)

1234                     .addComponent(editGradeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)

1235                     .addComponent(editYearTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))

1236                 .addGap(754, 754, 754))

1237         );

1238 

1239         dataManagementPane.addTab("Student Information", jPanel3);

1240 

1241         editVisaTable.setModel(new javax.swing.table.DefaultTableModel(

1242             new Object [][] {

1243                 {null, null, null, null, null, null, null, null},

1244                 {null, null, null, null, null, null, null, null},

1245                 {null, null, null, null, null, null, null, null},

1246                 {null, null, null, null, null, null, null, null},

1247                 {null, null, null, null, null, null, null, null},

1248                 {null, null, null, null, null, null, null, null},

1249                 {null, null, null, null, null, null, null, null},

1250                 {null, null, null, null, null, null, null, null},

1251                 {null, null, null, null, null, null, null, null},

1252                 {null, null, null, null, null, null, null, null},

1253                 {null, null, null, null, null, null, null, null},

1254                 {null, null, null, null, null, null, null, null},

1255                 {null, null, null, null, null, null, null, null},

1256                 {null, null, null, null, null, null, null, null},

1257                 {null, null, null, null, null, null, null, null},

1258                 {null, null, null, null, null, null, null, null},

1259                 {null, null, null, null, null, null, null, null},

1260                 {null, null, null, null, null, null, null, null},

1261                 {null, null, null, null, null, null, null, null},

1262                 {null, null, null, null, null, null, null, null},

1263                 {null, null, null, null, null, null, null, null},

1264                 {null, null, null, null, null, null, null, null},

1265                 {null, null, null, null, null, null, null, null},

1266                 {null, null, null, null, null, null, null, null},

1267                 {null, null, null, null, null, null, null, null},

1268                 {null, null, null, null, null, null, null, null},

1269                 {null, null, null, null, null, null, null, null},

1270                 {null, null, null, null, null, null, null, null},

1271                 {null, null, null, null, null, null, null, null},

1272                 {null, null, null, null, null, null, null, null}

1273             },

1274             new String [] {

1275                 "Full Name", "Passport Nationality", "Passport Number", "Passport Expiry Date", "Visa Required", "Visa Turned In", "Visa Number", "Visa Expiry Date"

1276             }

1277         ));

1278         editVisaTable.setGridColor(new java.awt.Color(0, 0, 0));

1279         editVisaTable.setShowGrid(true);

1280         jScrollPane7.setViewportView(editVisaTable);

1281 

1282         editPassportNumberTF.addActionListener(new java.awt.event.ActionListener() {

1283             public void actionPerformed(java.awt.event.ActionEvent evt) {

1284                 editPassportNumberTFActionPerformed(evt);

1285             }

1286         });

1287 

1288         editPassportExpiryDateTF.addActionListener(new java.awt.event.ActionListener() {

1289             public void actionPerformed(java.awt.event.ActionEvent evt) {

1290                 editPassportExpiryDateTFActionPerformed(evt);

1291             }

1292         });

1293 

1294         editVisaRequiredCheckBox.setText("Visa Required?");

1295 

1296         editVisaTurnedInCheckBox.setText("Visa Turned In?");

1297 

1298         showVisaButton.setText("show");

1299         showVisaButton.addMouseListener(new java.awt.event.MouseAdapter() {

1300             public void mouseReleased(java.awt.event.MouseEvent evt) {

1301                 showVisaButtonMouseReleased(evt);

1302             }

1303         });

1304 

1305         editVisaButton.setText("edit");

1306         editVisaButton.addMouseListener(new java.awt.event.MouseAdapter() {

1307             public void mouseReleased(java.awt.event.MouseEvent evt) {

1308                 editVisaButtonMouseReleased(evt);

1309             }

1310         });

1311 

1312         saveVisaButton.setText("save");

1313         saveVisaButton.addMouseListener(new java.awt.event.MouseAdapter() {

1314             public void mouseReleased(java.awt.event.MouseEvent evt) {

1315                 saveVisaButtonMouseReleased(evt);

1316             }

1317         });

1318 

1319         removeVisaButton.setText("remove");

1320         removeVisaButton.addMouseListener(new java.awt.event.MouseAdapter() {

1321             public void mouseReleased(java.awt.event.MouseEvent evt) {

1322                 removeVisaButtonMouseReleased(evt);

1323             }

1324         });

1325 

1326         jLabel15.setText("Row Num");

1327 

1328         jLabel16.setText("Passport Number");

1329 

1330         jLabel17.setText("Passport Expiry Date");

1331 

1332         jLabel18.setText("Visa Number");

1333 

1334         jLabel20.setText("Passport Nationality");

1335 

1336         jLabel23.setText("Visa Expiry Date");

1337 

1338         javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);

1339         jPanel1.setLayout(jPanel1Layout);

1340         jPanel1Layout.setHorizontalGroup(

1341             jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

1342             .addGroup(jPanel1Layout.createSequentialGroup()

1343                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

1344                     .addGroup(jPanel1Layout.createSequentialGroup()

1345                         .addGap(18, 18, 18)

1346                         .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

1347                             .addGroup(jPanel1Layout.createSequentialGroup()

1348                                 .addComponent(showVisaButton)

1349                                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)

1350                                 .addComponent(editVisaButton)

1351                                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)

1352                                 .addComponent(removeVisaButton)

1353                                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)

1354                                 .addComponent(saveVisaButton))

1355                             .addGroup(jPanel1Layout.createSequentialGroup()

1356                                 .addComponent(jLabel15)

1357                                 .addGap(18, 18, 18)

1358                                 .addComponent(rowToChooseVisaTF, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE))))

1359                     .addGroup(jPanel1Layout.createSequentialGroup()

1360                         .addGap(41, 41, 41)

1361                         .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

1362                             .addGroup(jPanel1Layout.createSequentialGroup()

1363                                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

1364                                     .addComponent(jLabel20)

1365                                     .addComponent(jLabel16)

1366                                     .addComponent(jLabel17))

1367                                 .addGap(25, 25, 25)

1368                                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

1369                                     .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)

1370                                         .addComponent(editPassportNumberTF, javax.swing.GroupLayout.DEFAULT_SIZE, 73, Short.MAX_VALUE)

1371                                         .addComponent(editPassportExpiryDateTF))

1372                                     .addComponent(editPassportNationalityTF, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE))

1373                                 .addGap(31, 31, 31)

1374                                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

1375                                     .addComponent(editVisaRequiredCheckBox)

1376                                     .addComponent(editVisaTurnedInCheckBox))

1377                                 .addGap(45, 45, 45)

1378                                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

1379                                     .addComponent(jLabel23)

1380                                     .addComponent(jLabel18))

1381                                 .addGap(28, 28, 28)

1382                                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)

1383                                     .addComponent(editVisaExpiryDateTF, javax.swing.GroupLayout.DEFAULT_SIZE, 71, Short.MAX_VALUE)

1384                                     .addComponent(editVisaNumberTF)))

1385                             .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 712, javax.swing.GroupLayout.PREFERRED_SIZE))))

1386                 .addContainerGap(60, Short.MAX_VALUE))

1387         );

1388         jPanel1Layout.setVerticalGroup(

1389             jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

1390             .addGroup(jPanel1Layout.createSequentialGroup()

1391                 .addGap(7, 7, 7)

1392                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)

1393                     .addComponent(showVisaButton)

1394                     .addComponent(editVisaButton)

1395                     .addComponent(saveVisaButton)

1396                     .addComponent(removeVisaButton))

1397                 .addGap(18, 18, 18)

1398                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)

1399                     .addComponent(jLabel15)

1400                     .addComponent(rowToChooseVisaTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))

1401                 .addGap(31, 31, 31)

1402                 .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 318, javax.swing.GroupLayout.PREFERRED_SIZE)

1403                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

1404                     .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()

1405                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)

1406                         .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)

1407                             .addComponent(editVisaRequiredCheckBox)

1408                             .addComponent(jLabel18)

1409                             .addComponent(editVisaNumberTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))

1410                         .addGap(18, 18, 18)

1411                         .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)

1412                             .addComponent(editVisaTurnedInCheckBox)

1413                             .addComponent(jLabel23, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)

1414                             .addComponent(editVisaExpiryDateTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))

1415                         .addGap(0, 0, Short.MAX_VALUE))

1416                     .addGroup(jPanel1Layout.createSequentialGroup()

1417                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 44, Short.MAX_VALUE)

1418                         .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)

1419                             .addComponent(jLabel20)

1420                             .addComponent(editPassportNationalityTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))

1421                         .addGap(18, 18, 18)

1422                         .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)

1423                             .addComponent(jLabel16)

1424                             .addComponent(editPassportNumberTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))

1425                         .addGap(22, 22, 22)

1426                         .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)

1427                             .addComponent(jLabel17)

1428                             .addComponent(editPassportExpiryDateTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))

1429                 .addContainerGap(25, Short.MAX_VALUE))

1430         );

1431 

1432         dataManagementPane.addTab("Visa Information", jPanel1);

1433 

1434         informationPane.addTab("Data Management", dataManagementPane);

1435 

1436         fileMenu.setMnemonic('f');

1437         fileMenu.setText("File");

1438 

1439         openMenuItem.setMnemonic('o');

1440         openMenuItem.setText("Open");

1441         fileMenu.add(openMenuItem);

1442 

1443         saveMenuItem.setMnemonic('s');

1444         saveMenuItem.setText("Save");

1445         fileMenu.add(saveMenuItem);

1446 

1447         saveAsMenuItem.setMnemonic('a');

1448         saveAsMenuItem.setText("Save As ...");

1449         saveAsMenuItem.setDisplayedMnemonicIndex(5);

1450         fileMenu.add(saveAsMenuItem);

1451 

1452         exitMenuItem.setMnemonic('x');

1453         exitMenuItem.setText("Exit");

1454         exitMenuItem.addActionListener(new java.awt.event.ActionListener() {

1455             public void actionPerformed(java.awt.event.ActionEvent evt) {

1456                 exitMenuItemActionPerformed(evt);

1457             }

1458         });

1459         fileMenu.add(exitMenuItem);

1460 

1461         menuBar.add(fileMenu);

1462 

1463         editMenu.setMnemonic('e');

1464         editMenu.setText("Edit");

1465 

1466         cutMenuItem.setMnemonic('t');

1467         cutMenuItem.setText("Cut");

1468         editMenu.add(cutMenuItem);

1469 

1470         copyMenuItem.setMnemonic('y');

1471         copyMenuItem.setText("Copy");

1472         editMenu.add(copyMenuItem);

1473 

1474         pasteMenuItem.setMnemonic('p');

1475         pasteMenuItem.setText("Paste");

1476         editMenu.add(pasteMenuItem);

1477 

1478         deleteMenuItem.setMnemonic('d');

1479         deleteMenuItem.setText("Delete");

1480         editMenu.add(deleteMenuItem);

1481 

1482         menuBar.add(editMenu);

1483 

1484         helpMenu.setMnemonic('h');

1485         helpMenu.setText("Help");

1486 

1487         contentsMenuItem.setMnemonic('c');

1488         contentsMenuItem.setText("Contents");

1489         helpMenu.add(contentsMenuItem);

1490 

1491         aboutMenuItem.setMnemonic('a');

1492         aboutMenuItem.setText("About");

1493         helpMenu.add(aboutMenuItem);

1494 

1495         menuBar.add(helpMenu);

1496 

1497         setJMenuBar(menuBar);

1498 

1499         javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());

1500         getContentPane().setLayout(layout);

1501         layout.setHorizontalGroup(

1502             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

1503             .addGroup(layout.createSequentialGroup()

1504                 .addGap(37, 37, 37)

1505                 .addComponent(informationPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)

1506                 .addContainerGap(63, Short.MAX_VALUE))

1507         );

1508         layout.setVerticalGroup(

1509             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

1510             .addGroup(layout.createSequentialGroup()

1511                 .addComponent(informationPane, javax.swing.GroupLayout.PREFERRED_SIZE, 708, javax.swing.GroupLayout.PREFERRED_SIZE)

1512                 .addGap(0, 190, Short.MAX_VALUE))

1513         );

1514 

1515         pack();

1516     }// </editor-fold>                        


1904     // Variables declaration - do not modify                     

1905     private javax.swing.JMenuItem aboutMenuItem;

1906     private javax.swing.JMenuItem contentsMenuItem;

1907     private javax.swing.JMenuItem copyMenuItem;

1908     private javax.swing.JMenuItem cutMenuItem;

1909     private javax.swing.JTabbedPane dataManagementPane;

1910     private javax.swing.JMenuItem deleteMenuItem;

1911     private javax.swing.JPanel displayPanel;

1912     private javax.swing.JTable displayQueryTable;

1913     private javax.swing.JComboBox<String> displaySortComboBox;

1914     private javax.swing.JTable displayTable;

1915     private javax.swing.JComboBox<String> displayVisaSortComboBox;

1916     private javax.swing.JTextField editFirstNameTF;

1917     private javax.swing.JComboBox<String> editGradeComboBox;

1918     private javax.swing.JTextField editIdNumTF;

1919     private javax.swing.JTextField editLastNameTF;

1920     private javax.swing.JMenu editMenu;

1921     private javax.swing.JTextField editPassportExpiryDateTF;

1922     private javax.swing.JTextField editPassportNationalityTF;

1923     private javax.swing.JTextField editPassportNumberTF;

1924     private javax.swing.JButton editStudentButton;

1925     private javax.swing.JTable editTStudentable;

1926     private javax.swing.JButton editVisaButton;

1927     private javax.swing.JTextField editVisaExpiryDateTF;

1928     private javax.swing.JTextField editVisaNumberTF;

1929     private javax.swing.JCheckBox editVisaRequiredCheckBox;

1930     private javax.swing.JTable editVisaTable;

1931     private javax.swing.JCheckBox editVisaTurnedInCheckBox;

1932     private javax.swing.JTextField editYearTF;

1933     private javax.swing.JMenuItem exitMenuItem;

1934     private javax.swing.JMenu fileMenu;

1935     private javax.swing.JTextField firstNameTF;

1936     private javax.swing.JComboBox<String> gradeComboBox;

1937     private javax.swing.JMenu helpMenu;

1938     private javax.swing.JTextField idNumTF;

1939     private javax.swing.JInternalFrame imageInternalFrame;

1940     private javax.swing.JTabbedPane informationPane;

1941     private javax.swing.JLabel jLabel1;

1942     private javax.swing.JLabel jLabel10;

1943     private javax.swing.JLabel jLabel11;

1944     private javax.swing.JLabel jLabel12;

1945     private javax.swing.JLabel jLabel13;

1946     private javax.swing.JLabel jLabel14;

1947     private javax.swing.JLabel jLabel15;

1948     private javax.swing.JLabel jLabel16;

1949     private javax.swing.JLabel jLabel17;

1950     private javax.swing.JLabel jLabel18;

1951     private javax.swing.JLabel jLabel2;

1952     private javax.swing.JLabel jLabel20;

1953     private javax.swing.JLabel jLabel23;

1954     private javax.swing.JLabel jLabel3;

1955     private javax.swing.JLabel jLabel4;

1956     private javax.swing.JLabel jLabel5;

1957     private javax.swing.JLabel jLabel6;

1958     private javax.swing.JLabel jLabel7;

1959     private javax.swing.JLabel jLabel8;

1960     private javax.swing.JLabel jLabel9;

1961     private javax.swing.JList<String> jList1;

1962     private javax.swing.JPanel jPanel1;

1963     private javax.swing.JPanel jPanel3;

1964     private javax.swing.JPopupMenu jPopupMenu1;

1965     private javax.swing.JScrollPane jScrollPane1;

1966     private javax.swing.JScrollPane jScrollPane2;

1967     private javax.swing.JScrollPane jScrollPane3;

1968     private javax.swing.JScrollPane jScrollPane6;

1969     private javax.swing.JScrollPane jScrollPane7;

1970     private javax.swing.JTextField jTextField1;

1971     private javax.swing.JTextField jTextField2;

1972     private javax.swing.JTextField lastNameTF;

1973     private javax.swing.JMenuBar menuBar;

1974     private javax.swing.JLabel numIDLabel;

1975     private javax.swing.JMenuItem openMenuItem;

1976     private javax.swing.JLabel passportExpiryDateLabel;

1977     private javax.swing.JTextField passportExpiryDateSampleTF;

1978     private javax.swing.JTextField passportExpiryDateTF;

1979     private javax.swing.JPanel passportInformationPanel;

1980     private javax.swing.JLabel passportNationalityLabel;

1981     private javax.swing.JTextField passportNationalityTF;

1982     private javax.swing.JTextField passportNumberTF;

1983     private javax.swing.JMenuItem pasteMenuItem;

1984     private javax.swing.JPanel queryPanel;

1985     private javax.swing.JButton refreshDisplayTableButton;

1986     private javax.swing.JButton refreshQueryTableButton;

1987     private javax.swing.JButton refreshStudentListButton;

1988     private javax.swing.JButton removeStudentButton;

1989     private javax.swing.JButton removeVisaButton;

1990     private javax.swing.JTextField rowToChooseStudentTF;

1991     private javax.swing.JTextField rowToChooseVisaTF;

1992     private javax.swing.JMenuItem saveAsMenuItem;

1993     private javax.swing.JMenuItem saveMenuItem;

1994     private javax.swing.JButton saveStudentButton;

1995     private javax.swing.JButton saveVisaButton;

1996     private javax.swing.JButton searchButton;

1997     private javax.swing.JComboBox<String> searchComboBox;

1998     private javax.swing.JTextField searchPassportExpiryDateTF;

1999     private javax.swing.JTextField searchPassportNationalityTF;

2000     private javax.swing.JTextField searchPassportNumberTF;

2001     private javax.swing.JTextField searchVisaExpiryDateTF;

2002     private javax.swing.JTextField searchVisaNumTF;

2003     private javax.swing.JTextField searchVisaTurnedInTF;

2004     private javax.swing.JButton showStudentButton;

2005     private javax.swing.JButton showVisaButton;

2006     private javax.swing.JLabel studentGradeLabel;

2007     private javax.swing.JButton studentInfoOKButton;

2008     private javax.swing.JPanel studentInformationPanel;

2009     private javax.swing.JLabel studentNameLabel;

2010     private javax.swing.JComboBox<String> studentNameVisaComboBox;

2011     private javax.swing.JLabel studentNameVisaLabel;

2012     private javax.swing.JButton uploadImageButton;

2013     private javax.swing.JTextField visaExpiryDataSampleTF;

2014     private javax.swing.JLabel visaExpiryDateLabel;

2015     private javax.swing.JTextField visaExpiryDateTF;

2016     private javax.swing.JButton visaInfoOKButton;

2017     private javax.swing.JLabel visaNumLabel;

2018     private javax.swing.JTextField visaNumTF;

2019     private javax.swing.JCheckBox visaRequiredCheckBox;

2020     private javax.swing.JCheckBox visaTurnedInCheckBox;

2021     private javax.swing.JTextField yearTF;

2022     // End of variables declaration                   

2023 

2024 

2025 }

2026