/Users/e1813314/Desktop/IA Final Submission 000307-0066/Product/Athletics Awards Netbeans Project/src/iacomsci_allan/MainGUI.java
   1 /*
   2  * To change this license header, choose License Headers in Project Properties.
   3  * To change this template file, choose Tools | Templates
   4  * and open the template in the editor.
   5  */
   6 package iacomsci_allan;
   7 
   8 import java.util.ArrayList;
   9 
  10 import javax.swing.JOptionPane;
  11 
  12 /**
  13  *
  14  * @author 13314
  15  */
  16 
  17 /*
  18 TO DO LIST of 11/16/17
  19 Fix and try to complete the write to file methods.
  20 Can start the read file methods if possible.
  21  */
  22 public class MainGUI extends javax.swing.JFrame {
  23 
  24     //Counter to see if a player has already been entered into the roster.
  25     private int nextPlayerCount = 0;
  26     private ArrayList<Player> holdArray = new ArrayList<>();
  27     private boolean isVarsity = false;
  28     private int gender = -99;
  29     private CreateFile c;
  30     private SortingAndSearching s = new SortingAndSearching();
  31     ArrayList<Roster> holder = new ArrayList<>();
  32     private boolean fileAlreadyWritten = false;
  33     boolean advancedSearchActive = false;
  34     String awardText = "";
  35 
  36     /*Extensibility List:
  37     - Allow for saving to and reading from whatever file chosen from the user, 
  38     rather than hard coding an address that is used each iteration.
  39     - Include another Jframe or JOption Panes that acts as an instructional 
  40     panel that explicitly outlines how to use the program. May be through step 
  41     by step instructons. 
  42     - Add a function that allows the user to edit current rosters or players 
  43     that are already stored.
  44     - Include a function that will calculate all awards to be given, at the 
  45     press of one button.
  46     - Allow the user to save what they have entered, in case they wish to 
  47     continue at a later time.
  48     - Create a button that enables the user to go back and edit the previous 
  49     player, if the roster
  50     hasn't been submitted yet.
  51     - Allow the user to enter their own position, or any other element seen 
  52     in combo boxes, in case the option they are looking for isn't present.
  53      */
  54     //Method to populate sport combo box according to season selected
  55     public void checkSeasonTab1() {
  56         //Checking which index has been selected in the season combo box
  57         switch (seasonComboBox1.getSelectedIndex() + 1) {
  58             //If selected index is 0
  59             case 1:
  60                 //Clear the sport combo box first
  61                 sportComboBox1.removeAllItems();
  62                 sportComboBox1.addItem("Football");
  63                 sportComboBox1.addItem("Volleyball");
  64                 sportComboBox1.addItem("Cross Country");
  65                 break;
  66             //If sleected index is 1   
  67             case 2:
  68                 sportComboBox1.removeAllItems();
  69                 sportComboBox1.addItem("Basketball");
  70                 sportComboBox1.addItem("Swimming");
  71                 sportComboBox1.addItem("Tennis");
  72                 sportComboBox1.addItem("Rugby");
  73                 break;
  74             //If selected index is 2 
  75             case 3:
  76                 sportComboBox1.removeAllItems();
  77                 sportComboBox1.addItem("Baseball");
  78                 sportComboBox1.addItem("Track and Field");
  79                 sportComboBox1.addItem("Badminton");
  80                 sportComboBox1.addItem("Golf");
  81                 break;
  82         }
  83     }
  84 
  85     
  86 
  87     public boolean advancedSearchActive() {
  88         return advancedSearchActive;
  89     }
  90 
  91     public void sortJustByYear() {
  92         ArrayList<Roster> tempList = new ArrayList<Roster>();
  93         if (c.checkVarsityMaleFileCreated()) {
  94             if (c.checkVarsityMaleFileWritten()) {
  95                 tempList = c.getListVarsityMale();
  96                 System.out.println(tempList.size());
  97                 c.clearVarsityMaleFile();
  98                 s.sortByYear(tempList);
  99                 c.writeFileVarsityMale(tempList);
 100             }
 101         }
 102 
 103 //        if (c.checkVarsityFemaleFileCreated()) {
 104 //            if (c.checkVarsityFemaleFileWritten()) {
 105 //                tempList = c.getListVarsityFemale();
 106 //                c.clearVarsityFemaleFile();
 107 //                c.writeFileVarsityFemale(s.sortByYear(tempList));
 108 //            }
 109 //        }
 110 //
 111 //        if (c.checkJVmaleFileCreated()) {
 112 //            if (c.checkJVmaleFileWritten()) {
 113 //                tempList = c.getListJVmale();
 114 //                c.clearJVmaleFile();
 115 //                c.writeFileJVmale(s.sortByYear(tempList));
 116 //            }
 117 //        }
 118 //
 119 //        if (c.checkJVfemaleFileCreated()) {
 120 //            if (c.checkJVfemaleFileWritten()) {
 121 //                tempList = c.getListJVfemale();
 122 //                c.clearJVfemaleFile();
 123 //                c.writeFileJVfemale(s.sortByYear(tempList));
 124 //            }
 125 //        }
 126     }
 127 
 128     public void sortJustBySeason() {
 129         if (c.checkVarsityMaleFileCreated()) {
 130             if (c.checkVarsityMaleFileWritten()) {
 131                 c.writeFileVarsityMale(s.sortBySeason(c.getListVarsityMale()));
 132             }
 133         }
 134 
 135         if (c.checkVarsityFemaleFileCreated()) {
 136             if (c.checkVarsityFemaleFileWritten()) {
 137                 c.writeFileVarsityFemale(s.sortBySeason(c.getListVarsityFemale()));
 138             }
 139         }
 140 
 141         if (c.checkJVmaleFileCreated()) {
 142             if (c.checkJVmaleFileWritten()) {
 143                 c.writeFileJVmale(s.sortBySeason(c.getListJVmale()));
 144             }
 145         }
 146 
 147         if (c.checkJVfemaleFileCreated()) {
 148             if (c.checkJVfemaleFileWritten()) {
 149                 c.writeFileJVfemale(s.sortBySeason(c.getListJVfemale()));
 150             }
 151         }
 152     }
 153 
 154     public void sortJustBySport() {
 155         if (c.checkVarsityMaleFileCreated()) {
 156             if (c.checkVarsityMaleFileWritten()) {
 157                 c.writeFileVarsityMale(s.sortBySport(c.getListVarsityMale()));
 158             }
 159         }
 160 
 161         if (c.checkVarsityFemaleFileCreated()) {
 162             if (c.checkVarsityFemaleFileWritten()) {
 163                 c.writeFileVarsityFemale(s.sortBySport(c.getListVarsityFemale()));
 164             }
 165         }
 166 
 167         if (c.checkJVmaleFileCreated()) {
 168             if (c.checkJVmaleFileWritten()) {
 169                 c.writeFileJVmale(s.sortBySport(c.getListJVmale()));
 170             }
 171         }
 172 
 173         if (c.checkJVfemaleFileCreated()) {
 174             if (c.checkJVfemaleFileWritten()) {
 175 //                c.writeFileJVfemale(s.sortByYear(c.getListJVfemale()));
 176             }
 177         }
 178     }
 179 
 180     /**
 181      * Creates new form PrototypeGUI
 182      */
 183     public MainGUI() {
 184 
 185         this.c = new CreateFile();
 186 
 187         initComponents();
 188         checkSeasonTab1();
 189         isIASASLabel.setVisible(false);
 190         isIASAScheckBox.setVisible(false);
 191        
 192 
 193 //        //Checking to see if the file has already been created
 194 //        if (c.checkFileWritten())
 195 //        {
 196 //            //If the file has been created, it is read from.
 197 //            holder = c.getHolderArrayList();
 198 //        }
 199 //        else
 200 //        {
 201 //            //If the file hasn't been created, then it is created now.
 202 //            c.initialWrite();
 203 //        }
 204         playerLabel1.setText("Player " + (nextPlayerCount + 1));
 205 
 206         //Constructing the Display Table
 207         displayTable1.setModel(new javax.swing.table.DefaultTableModel(
 208                 new Object[][]{
 209                     {null, null, null, null, null},
 210                     {null, null, null, null, null},
 211                     {null, null, null, null, null},
 212                     {null, null, null, null, null}
 213                 },
 214                 new String[]{
 215                     "Season", "Sport", "Year", "Varsity", "Gender"
 216                 }
 217         ));
 218 
 219     }
 220 
 221     /**
 222      * This method is called from within the constructor to initialize the form.
 223      * WARNING: Do NOT modify this code. The content of this method is always
 224      * regenerated by the Form Editor.
 225      */
 226     @SuppressWarnings("unchecked")
 227     // <editor-fold defaultstate="collapsed" desc="Generated Code">                          
 228     private void initComponents() {
 229 
 230         jInternalFrame1 = new javax.swing.JInternalFrame();
 231         varsityJVbuttonGroup = new javax.swing.ButtonGroup();
 232         jLayeredPane1 = new javax.swing.JLayeredPane();
 233         genderButtonGroup = new javax.swing.ButtonGroup();
 234         searchPlayerPane = new javax.swing.JTabbedPane();
 235         jPanel1 = new javax.swing.JPanel();
 236         seasonLabel1 = new javax.swing.JLabel();
 237         sportLabel1 = new javax.swing.JLabel();
 238         sportComboBox1 = new javax.swing.JComboBox<>();
 239         fnField1 = new javax.swing.JTextField();
 240         lnField1 = new javax.swing.JTextField();
 241         gradeComboBox1 = new javax.swing.JComboBox<>();
 242         nextPlayerButton = new javax.swing.JButton();
 243         firstNameLabel1 = new javax.swing.JLabel();
 244         lastNameLabel1 = new javax.swing.JLabel();
 245         positionLabel1 = new javax.swing.JLabel();
 246         playerLabel1 = new javax.swing.JLabel();
 247         sumbitRosterButton = new javax.swing.JButton();
 248         positionComboBox1 = new javax.swing.JComboBox<>();
 249         gradeLabel1 = new javax.swing.JLabel();
 250         yearComboBox1 = new javax.swing.JComboBox<>();
 251         yearLabel1 = new javax.swing.JLabel();
 252         varsityRB = new javax.swing.JRadioButton();
 253         jvRB = new javax.swing.JRadioButton();
 254         isIASASLabel = new javax.swing.JLabel();
 255         isIASAScheckBox = new javax.swing.JCheckBox();
 256         maleRB = new javax.swing.JRadioButton();
 257         femaleRB = new javax.swing.JRadioButton();
 258         levelLabel1 = new javax.swing.JLabel();
 259         genderLabel1 = new javax.swing.JLabel();
 260         seasonComboBox1 = new javax.swing.JComboBox<>();
 261         jPanel2 = new javax.swing.JPanel();
 262         jScrollPane1 = new javax.swing.JScrollPane();
 263         displayTable1 = new javax.swing.JTable();
 264         sortBySeasonButton = new javax.swing.JButton();
 265         displayAllRostersButton = new javax.swing.JButton();
 266         clearTableButton = new javax.swing.JButton();
 267         jSeparator1 = new javax.swing.JSeparator();
 268         sortBySportButton = new javax.swing.JButton();
 269         sortByYearButton = new javax.swing.JButton();
 270         jPanel3 = new javax.swing.JPanel();
 271         jScrollPane2 = new javax.swing.JScrollPane();
 272         playerDisplayArea = new javax.swing.JTextArea();
 273         enterButton = new javax.swing.JButton();
 274         jLabel10 = new javax.swing.JLabel();
 275         showAwardsButton = new javax.swing.JButton();
 276         lastNameLabel2 = new javax.swing.JLabel();
 277         lnField2 = new javax.swing.JTextField();
 278         fnField2 = new javax.swing.JTextField();
 279         jPanel4 = new javax.swing.JPanel();
 280         clearRosterButton = new javax.swing.JToggleButton();
 281 
 282         jInternalFrame1.setVisible(true);
 283 
 284         javax.swing.GroupLayout jInternalFrame1Layout = new javax.swing.GroupLayout(jInternalFrame1.getContentPane());
 285         jInternalFrame1.getContentPane().setLayout(jInternalFrame1Layout);
 286         jInternalFrame1Layout.setHorizontalGroup(
 287             jInternalFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 288             .addGap(0, 0, Short.MAX_VALUE)
 289         );
 290         jInternalFrame1Layout.setVerticalGroup(
 291             jInternalFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 292             .addGap(0, 0, Short.MAX_VALUE)
 293         );
 294 
 295         javax.swing.GroupLayout jLayeredPane1Layout = new javax.swing.GroupLayout(jLayeredPane1);
 296         jLayeredPane1.setLayout(jLayeredPane1Layout);
 297         jLayeredPane1Layout.setHorizontalGroup(
 298             jLayeredPane1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 299             .addGap(0, 100, Short.MAX_VALUE)
 300         );
 301         jLayeredPane1Layout.setVerticalGroup(
 302             jLayeredPane1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 303             .addGap(0, 100, Short.MAX_VALUE)
 304         );
 305 
 306         setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
 307 
 308         seasonLabel1.setText("Season");
 309 
 310         sportLabel1.setText("Sport");
 311 
 312         gradeComboBox1.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "8", "9", "10", "11", "12" }));
 313 
 314         nextPlayerButton.setText("Next Player");
 315         nextPlayerButton.addActionListener(new java.awt.event.ActionListener() {
 316             public void actionPerformed(java.awt.event.ActionEvent evt) {
 317                 nextPlayerButtonActionPerformed(evt);
 318             }
 319         });
 320 
 321         firstNameLabel1.setText("First Name:");
 322 
 323         lastNameLabel1.setText("Last Name:");
 324 
 325         positionLabel1.setText("Position:");
 326 
 327         playerLabel1.setText("Player 1");
 328 
 329         sumbitRosterButton.setText("Submit Roster");
 330         sumbitRosterButton.addActionListener(new java.awt.event.ActionListener() {
 331             public void actionPerformed(java.awt.event.ActionEvent evt) {
 332                 sumbitRosterButtonActionPerformed(evt);
 333             }
 334         });
 335 
 336         positionComboBox1.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Captain", "Co-Captain", "Player", "Manager" }));
 337 
 338         gradeLabel1.setText("Grade:");
 339 
 340         yearComboBox1.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "2014", "2015", "2016", "2017", "2018", "2019", "2020", "2021", "2022", "2023", "2024", "2025", "2026", "2027", "2028", "2029", "2030" }));
 341 
 342         yearLabel1.setText("Year");
 343 
 344         varsityJVbuttonGroup.add(varsityRB);
 345         varsityRB.setText("Varsity");
 346         varsityRB.addActionListener(new java.awt.event.ActionListener() {
 347             public void actionPerformed(java.awt.event.ActionEvent evt) {
 348                 varsityRBActionPerformed(evt);
 349             }
 350         });
 351 
 352         varsityJVbuttonGroup.add(jvRB);
 353         jvRB.setText("JV");
 354         jvRB.addActionListener(new java.awt.event.ActionListener() {
 355             public void actionPerformed(java.awt.event.ActionEvent evt) {
 356                 jvRBActionPerformed(evt);
 357             }
 358         });
 359 
 360         isIASASLabel.setText("Is IASAS:");
 361 
 362         isIASAScheckBox.setText("Yes");
 363 
 364         genderButtonGroup.add(maleRB);
 365         maleRB.setText("Male");
 366 
 367         genderButtonGroup.add(femaleRB);
 368         femaleRB.setText("Female");
 369 
 370         levelLabel1.setText("Level:");
 371 
 372         genderLabel1.setText("Gender:");
 373 
 374         seasonComboBox1.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "1", "2", "3" }));
 375         seasonComboBox1.addItemListener(new java.awt.event.ItemListener() {
 376             public void itemStateChanged(java.awt.event.ItemEvent evt) {
 377                 seasonComboBox1ItemStateChanged(evt);
 378             }
 379         });
 380 
 381         javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
 382         jPanel1.setLayout(jPanel1Layout);
 383         jPanel1Layout.setHorizontalGroup(
 384             jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 385             .addGroup(jPanel1Layout.createSequentialGroup()
 386                 .addGap(195, 195, 195)
 387                 .addComponent(sumbitRosterButton)
 388                 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
 389             .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
 390                 .addGap(24, 24, 24)
 391                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 392                     .addComponent(sportComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE)
 393                     .addComponent(yearComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE)
 394                     .addComponent(sportLabel1)
 395                     .addComponent(yearLabel1)
 396                     .addComponent(seasonLabel1)
 397                     .addComponent(seasonComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
 398                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
 399                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
 400                     .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 401                         .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
 402                             .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 403                                 .addComponent(isIASASLabel)
 404                                 .addComponent(positionLabel1)
 405                                 .addComponent(gradeLabel1)
 406                                 .addComponent(levelLabel1))
 407                             .addGap(39, 39, 39))
 408                         .addGroup(jPanel1Layout.createSequentialGroup()
 409                             .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 410                                 .addComponent(playerLabel1)
 411                                 .addComponent(lastNameLabel1)
 412                                 .addComponent(genderLabel1))
 413                             .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
 414                     .addGroup(jPanel1Layout.createSequentialGroup()
 415                         .addComponent(firstNameLabel1)
 416                         .addGap(24, 24, 24)))
 417                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 418                     .addComponent(nextPlayerButton)
 419                     .addComponent(positionComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
 420                     .addComponent(gradeComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
 421                     .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
 422                         .addComponent(lnField1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 106, Short.MAX_VALUE)
 423                         .addComponent(fnField1, javax.swing.GroupLayout.Alignment.LEADING))
 424                     .addGroup(jPanel1Layout.createSequentialGroup()
 425                         .addComponent(maleRB)
 426                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 427                         .addComponent(femaleRB))
 428                     .addComponent(isIASAScheckBox)
 429                     .addGroup(jPanel1Layout.createSequentialGroup()
 430                         .addComponent(varsityRB)
 431                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
 432                         .addComponent(jvRB)))
 433                 .addGap(52, 52, 52))
 434         );
 435         jPanel1Layout.setVerticalGroup(
 436             jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 437             .addGroup(jPanel1Layout.createSequentialGroup()
 438                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 439                     .addGroup(jPanel1Layout.createSequentialGroup()
 440                         .addGap(51, 51, 51)
 441                         .addComponent(seasonComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
 442                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 443                         .addComponent(sportLabel1))
 444                     .addGroup(jPanel1Layout.createSequentialGroup()
 445                         .addGap(29, 29, 29)
 446                         .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
 447                             .addComponent(seasonLabel1)
 448                             .addComponent(maleRB)
 449                             .addComponent(femaleRB))
 450                         .addGap(20, 20, 20)
 451                         .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
 452                             .addComponent(firstNameLabel1)
 453                             .addComponent(fnField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
 454                     .addGroup(jPanel1Layout.createSequentialGroup()
 455                         .addComponent(playerLabel1)
 456                         .addGap(18, 18, 18)
 457                         .addComponent(genderLabel1)))
 458                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
 459                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 460                     .addComponent(sportComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
 461                     .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
 462                         .addComponent(lnField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
 463                         .addComponent(lastNameLabel1)))
 464                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 465                     .addGroup(jPanel1Layout.createSequentialGroup()
 466                         .addGap(38, 38, 38)
 467                         .addComponent(yearLabel1)
 468                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 469                         .addComponent(yearComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
 470                     .addGroup(jPanel1Layout.createSequentialGroup()
 471                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 472                         .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
 473                             .addComponent(gradeComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
 474                             .addComponent(gradeLabel1))
 475                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
 476                         .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
 477                             .addComponent(varsityRB)
 478                             .addComponent(jvRB)
 479                             .addComponent(levelLabel1))
 480                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
 481                         .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
 482                             .addComponent(isIASAScheckBox)
 483                             .addComponent(isIASASLabel))))
 484                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 62, Short.MAX_VALUE)
 485                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
 486                     .addComponent(positionLabel1)
 487                     .addComponent(positionComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
 488                 .addGap(39, 39, 39)
 489                 .addComponent(nextPlayerButton)
 490                 .addGap(17, 17, 17)
 491                 .addComponent(sumbitRosterButton))
 492         );
 493 
 494         searchPlayerPane.addTab("Enter Roster", jPanel1);
 495 
 496         displayTable1.setModel(new javax.swing.table.DefaultTableModel(
 497             new Object [][] {
 498                 {null, null, null, null},
 499                 {null, null, null, null},
 500                 {null, null, null, null},
 501                 {null, null, null, null}
 502             },
 503             new String [] {
 504                 "Title 1", "Title 2", "Title 3", "Title 4"
 505             }
 506         ));
 507         jScrollPane1.setViewportView(displayTable1);
 508 
 509         sortBySeasonButton.setText("Season");
 510         sortBySeasonButton.addActionListener(new java.awt.event.ActionListener() {
 511             public void actionPerformed(java.awt.event.ActionEvent evt) {
 512                 sortBySeasonButtonActionPerformed(evt);
 513             }
 514         });
 515 
 516         displayAllRostersButton.setText("Display All Rosters");
 517         displayAllRostersButton.addActionListener(new java.awt.event.ActionListener() {
 518             public void actionPerformed(java.awt.event.ActionEvent evt) {
 519                 displayAllRostersButtonActionPerformed(evt);
 520             }
 521         });
 522 
 523         clearTableButton.setText("Clear Display Table");
 524         clearTableButton.addActionListener(new java.awt.event.ActionListener() {
 525             public void actionPerformed(java.awt.event.ActionEvent evt) {
 526                 clearTableButtonActionPerformed(evt);
 527             }
 528         });
 529 
 530         sortBySportButton.setText("Sport");
 531         sortBySportButton.addActionListener(new java.awt.event.ActionListener() {
 532             public void actionPerformed(java.awt.event.ActionEvent evt) {
 533                 sortBySportButtonActionPerformed(evt);
 534             }
 535         });
 536 
 537         sortByYearButton.setText("Year");
 538         sortByYearButton.addActionListener(new java.awt.event.ActionListener() {
 539             public void actionPerformed(java.awt.event.ActionEvent evt) {
 540                 sortByYearButtonActionPerformed(evt);
 541             }
 542         });
 543 
 544         javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
 545         jPanel2.setLayout(jPanel2Layout);
 546         jPanel2Layout.setHorizontalGroup(
 547             jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 548             .addGroup(jPanel2Layout.createSequentialGroup()
 549                 .addGap(192, 192, 192)
 550                 .addComponent(sortByYearButton)
 551                 .addGap(52, 52, 52)
 552                 .addComponent(sortBySeasonButton)
 553                 .addGap(62, 62, 62)
 554                 .addComponent(sortBySportButton)
 555                 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
 556             .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
 557                 .addContainerGap(101, Short.MAX_VALUE)
 558                 .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
 559                     .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 529, javax.swing.GroupLayout.PREFERRED_SIZE)
 560                     .addGroup(jPanel2Layout.createSequentialGroup()
 561                         .addComponent(displayAllRostersButton)
 562                         .addGap(31, 31, 31)
 563                         .addComponent(clearTableButton)
 564                         .addGap(64, 64, 64))
 565                     .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 535, javax.swing.GroupLayout.PREFERRED_SIZE))
 566                 .addGap(86, 86, 86))
 567         );
 568         jPanel2Layout.setVerticalGroup(
 569             jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 570             .addGroup(jPanel2Layout.createSequentialGroup()
 571                 .addContainerGap()
 572                 .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
 573                     .addComponent(displayAllRostersButton)
 574                     .addComponent(clearTableButton))
 575                 .addGap(34, 34, 34)
 576                 .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
 577                     .addComponent(sortBySeasonButton)
 578                     .addComponent(sortBySportButton)
 579                     .addComponent(sortByYearButton))
 580                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 581                 .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
 582                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 583                 .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 297, javax.swing.GroupLayout.PREFERRED_SIZE)
 584                 .addContainerGap(26, Short.MAX_VALUE))
 585         );
 586 
 587         searchPlayerPane.addTab("View Rosters", jPanel2);
 588 
 589         playerDisplayArea.setEditable(false);
 590         playerDisplayArea.setColumns(20);
 591         playerDisplayArea.setRows(5);
 592         playerDisplayArea.setText("Name:\n\nGrade:\n\nSeason:\n\nVarsity Sports and Years:\n\nIASAS Years:\n\n\n\n");
 593         playerDisplayArea.setDragEnabled(false);
 594         playerDisplayArea.setFocusable(false);
 595         jScrollPane2.setViewportView(playerDisplayArea);
 596 
 597         enterButton.setText("Enter");
 598         enterButton.addActionListener(new java.awt.event.ActionListener() {
 599             public void actionPerformed(java.awt.event.ActionEvent evt) {
 600                 enterButtonActionPerformed(evt);
 601             }
 602         });
 603 
 604         jLabel10.setText("First Name:");
 605 
 606         showAwardsButton.setText("Show Awards To be Given");
 607         showAwardsButton.addActionListener(new java.awt.event.ActionListener() {
 608             public void actionPerformed(java.awt.event.ActionEvent evt) {
 609                 showAwardsButtonActionPerformed(evt);
 610             }
 611         });
 612 
 613         lastNameLabel2.setText("Last Name:");
 614 
 615         javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
 616         jPanel3.setLayout(jPanel3Layout);
 617         jPanel3Layout.setHorizontalGroup(
 618             jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 619             .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
 620                 .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 621                     .addGroup(jPanel3Layout.createSequentialGroup()
 622                         .addGap(48, 48, 48)
 623                         .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
 624                             .addComponent(jLabel10)
 625                             .addComponent(lastNameLabel2)
 626                             .addComponent(lnField2, javax.swing.GroupLayout.DEFAULT_SIZE, 80, Short.MAX_VALUE)
 627                             .addComponent(fnField2))
 628                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
 629                     .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
 630                         .addContainerGap(247, Short.MAX_VALUE)
 631                         .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 632                             .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
 633                                 .addComponent(enterButton, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
 634                                 .addGap(137, 137, 137))
 635                             .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
 636                                 .addComponent(showAwardsButton)
 637                                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)))))
 638                 .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 252, javax.swing.GroupLayout.PREFERRED_SIZE)
 639                 .addContainerGap())
 640         );
 641         jPanel3Layout.setVerticalGroup(
 642             jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 643             .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.TRAILING)
 644             .addGroup(jPanel3Layout.createSequentialGroup()
 645                 .addGap(44, 44, 44)
 646                 .addComponent(jLabel10)
 647                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 648                 .addComponent(fnField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
 649                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
 650                 .addComponent(lastNameLabel2)
 651                 .addGap(9, 9, 9)
 652                 .addComponent(lnField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
 653                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
 654                 .addComponent(enterButton)
 655                 .addGap(18, 18, 18)
 656                 .addComponent(showAwardsButton)
 657                 .addContainerGap(202, Short.MAX_VALUE))
 658         );
 659 
 660         searchPlayerPane.addTab("Search Player", jPanel3);
 661 
 662         clearRosterButton.setText("Clear Rosters");
 663         clearRosterButton.addActionListener(new java.awt.event.ActionListener() {
 664             public void actionPerformed(java.awt.event.ActionEvent evt) {
 665                 clearRosterButtonActionPerformed(evt);
 666             }
 667         });
 668 
 669         javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
 670         jPanel4.setLayout(jPanel4Layout);
 671         jPanel4Layout.setHorizontalGroup(
 672             jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 673             .addGroup(jPanel4Layout.createSequentialGroup()
 674                 .addGap(229, 229, 229)
 675                 .addComponent(clearRosterButton)
 676                 .addContainerGap(366, Short.MAX_VALUE))
 677         );
 678         jPanel4Layout.setVerticalGroup(
 679             jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 680             .addGroup(jPanel4Layout.createSequentialGroup()
 681                 .addGap(59, 59, 59)
 682                 .addComponent(clearRosterButton)
 683                 .addContainerGap(357, Short.MAX_VALUE))
 684         );
 685 
 686         searchPlayerPane.addTab("Settings", jPanel4);
 687 
 688         javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
 689         getContentPane().setLayout(layout);
 690         layout.setHorizontalGroup(
 691             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 692             .addGroup(layout.createSequentialGroup()
 693                 .addContainerGap()
 694                 .addComponent(searchPlayerPane))
 695         );
 696         layout.setVerticalGroup(
 697             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 698             .addGroup(layout.createSequentialGroup()
 699                 .addComponent(searchPlayerPane)
 700                 .addContainerGap())
 701         );
 702 
 703         pack();
 704     }// </editor-fold>                        
 705 
 706     private void sumbitRosterButtonActionPerformed(java.awt.event.ActionEvent evt) {                                                   
 707         // TODO add your handling code here:
 708         //Checking to see what gender the roster is
 709         /*Roster Types:
 710         1 = Varsity Male
 711         2 = Varsity Female
 712         3 = JV Male
 713         4 = JV Female
 714          */
 715         int type = -99;
 716 
 717         if (maleRB.isSelected() && varsityRB.isSelected()) {
 718             type = 1;
 719         } else if (femaleRB.isSelected() && varsityRB.isSelected()) {
 720             type = 2;
 721         } else if (maleRB.isSelected() && jvRB.isSelected()) {
 722             type = 3;
 723         } else if (femaleRB.isSelected() && jvRB.isSelected()) {
 724             type = 4;
 725         }
 726 
 727         nextPlayerCount = 0;
 728 
 729         switch (type) {
 730             case 1:
 731                 if (!c.checkVarsityMaleFileCreated()) {
 732                     c.initialWriteVarsityMale();
 733                 } else if (c.checkVarsityMaleFileWritten()) {
 734                     holder = c.getListVarsityMale();
 735                 }
 736                 holder.add(new Roster(holdArray, sportComboBox1.getSelectedItem().toString(),
 737                         Integer.parseInt(seasonComboBox1.getSelectedItem().toString()), Integer.parseInt(yearComboBox1.getSelectedItem().toString()),
 738                         true, 1));
 739                 //c.clearVarsityMaleFile();
 740                 c.writeFileVarsityMale(holder);
 741                 break;
 742 
 743             case 2:
 744                 if (!c.checkVarsityFemaleFileCreated()) {
 745                     c.initialWriteVarsityFemale();
 746                 } else if (c.checkVarsityFemaleFileWritten()) {
 747                     holder = c.getListVarsityFemale();
 748                 }
 749                 holder.add(new Roster(holdArray, sportComboBox1.getSelectedItem().toString(),
 750                         Integer.parseInt(seasonComboBox1.getSelectedItem().toString()), Integer.parseInt(yearComboBox1.getSelectedItem().toString()),
 751                         true, 2));
 752                 c.clearVarsityFemaleFile();
 753                 c.writeFileVarsityFemale(holder);
 754                 break;
 755 
 756             case 3:
 757                 if (!c.checkJVmaleFileCreated()) {
 758                     c.initialWriteJVmale();
 759                 } else if (c.checkJVmaleFileWritten()) {
 760                     holder = c.getListJVmale();
 761                 }
 762                 holder.add(new Roster(holdArray, sportComboBox1.getSelectedItem().toString(),
 763                         Integer.parseInt(seasonComboBox1.getSelectedItem().toString()), Integer.parseInt(yearComboBox1.getSelectedItem().toString()),
 764                         false, 1));
 765                 c.clearJVmaleFile();
 766                 c.writeFileJVmale(holder);
 767                 break;
 768 
 769             case 4:
 770                 if (!c.checkJVfemaleFileCreated()) {
 771                     c.initialWriteJVfemale();
 772                 } else if (c.checkJVfemaleFileWritten()) {
 773                     holder = c.getListJVfemale();
 774                 }
 775                 holder.add(new Roster(holdArray, sportComboBox1.getSelectedItem().toString(),
 776                         Integer.parseInt(seasonComboBox1.getSelectedItem().toString()), Integer.parseInt(yearComboBox1.getSelectedItem().toString()),
 777                         false, 2));
 778                 c.clearJVfemaleFile();
 779                 c.writeFileJVfemale(holder);
 780                 break;
 781         }
 782         holder.clear();
 783 
 784 //      
 785         varsityRB.setEnabled(true);
 786         jvRB.setEnabled(true);
 787         maleRB.setEnabled(true);
 788         femaleRB.setEnabled(true);
 789         holdArray.clear();
 790     }                                                  
 791 
 792     private void nextPlayerButtonActionPerformed(java.awt.event.ActionEvent evt) {                                                 
 793         // TODO add your handling code here:
 794         if (!maleRB.isSelected() && !femaleRB.isSelected()) {
 795             JOptionPane.showMessageDialog(this, "Please select a gender!");
 796         } else {
 797             playerLabel1.setText("Player " + (nextPlayerCount + 1));
 798 
 799             //Check to see if a player has already been entered.
 800             if (nextPlayerCount == 0) {
 801 //            //Disabling the roster attribute changes so that each player is consistent
 802 //            seasonComboBox1.setEnabled(false);
 803 //            sportComboBox1.setEnabled(false);
 804 //            yearComboBox1.setEnabled(false);
 805                 if (varsityRB.isSelected()) {
 806                     varsityRB.setEnabled(false);
 807                     jvRB.setEnabled(false);
 808                     isVarsity = true;
 809                 } else if (jvRB.isSelected()) {
 810                     jvRB.setEnabled(false);
 811                     isVarsity = false;
 812                 }
 813                 if (maleRB.isSelected()) {
 814                     maleRB.setEnabled(false);
 815                     femaleRB.setEnabled(false);
 816                 } else if (femaleRB.isSelected()) {
 817                     maleRB.setEnabled(false);
 818                     femaleRB.setEnabled(false);
 819                 }
 820             }
 821             //Adding the player to the roster, which is called the holdArray.
 822             //Conditional to check varsity of JV first. 
 823             if (isVarsity) {
 824                 holdArray.add(new Varsity(fnField1.getText(), lnField1.getText(), Integer.parseInt(gradeComboBox1.getSelectedItem().toString()),
 825                         positionComboBox1.getSelectedItem().toString(), isIASAScheckBox.isSelected()));
 826             } else {
 827                 holdArray.add(new JV(fnField1.getText(), lnField1.getText(), Integer.parseInt(gradeComboBox1.getSelectedItem().toString()),
 828                         positionComboBox1.getSelectedItem().toString()));
 829             }
 830 
 831             fnField1.setText("");
 832             lnField1.setText("");
 833             gradeComboBox1.setSelectedIndex(0);
 834             isIASAScheckBox.setSelected(false);
 835             positionComboBox1.setSelectedIndex(0);
 836             nextPlayerCount++;
 837         }
 838     }                                                
 839 
 840     private void sortBySeasonButtonActionPerformed(java.awt.event.ActionEvent evt) {                                                   
 841         // TODO add your handling code here:
 842 
 843         sortJustBySeason();
 844         displayAllRostersButtonActionPerformed(evt);
 845 
 846     }                                                  
 847 
 848     private void enterButtonActionPerformed(java.awt.event.ActionEvent evt) {                                            
 849         // TODO add your handling code here:
 850         ArrayList<Roster> temp = new ArrayList();
 851         temp = c.getListVarsityMale();
 852         s.sortPlayersInRoster(temp);
 853         c.clearVarsityMale();
 854         c.writeFileVarsityMale(temp);
 855         ArrayList<String> data = new ArrayList();
 856         //sending the data for the searched player into the arrayList data
 857         data = s.searchPlayer(c.getListVarsityMale(), fnField2.getText());
 858         //Outputting the data for the searched player
 859         playerDisplayArea.setText("Name: " + data.get(0) + " " + data.get(1) + "\n\nGrade: " + data.get(2) + "\n\nSport: " + data.get(3)
 860                 + "\n\nVarsity Seasons: " + data.get(4) + "\n\nIASAS Seasons: " + data.get(5));
 861 
 862         //New arrayList to keep track of which seasons the player has played in
 863         ArrayList seasonsPlayed = new ArrayList();
 864         //The seasons were added onto eachother as strings to create a number with digits ranging from 1 to 3
 865         //The length of the number was found using char values
 866         int length = data.get(6).length();
 867         //For loop to add each letter using the char value to the seasonsPlayed array
 868         for (int i = 0; i < length; i++) {
 869             seasonsPlayed.add(data.get(6).charAt(i));
 870         }
 871 
 872         //Initialize the counters of each season
 873         int season1Counter = 0;
 874         int season2Counter = 0;
 875         int season3Counter = 0;
 876         
 877         //Incrementing according to each season
 878         for (int i = 0; i < seasonsPlayed.size(); i++) {
 879             switch (Integer.parseInt(seasonsPlayed.get(i).toString())) {
 880 
 881                 case 1:
 882                     season1Counter++;
 883                     break;
 884 
 885                 case 2:
 886                     season2Counter++;
 887                     break;
 888 
 889                 case 3:
 890                     season3Counter++;
 891                     break;
 892 
 893             }
 894         }
 895         
 896         //Switch case to determine the relevant awards depending on which grade the player is in
 897         //Algorithm becomes slightly different according to each grade.
 898         switch (Integer.parseInt(data.get(2))) {
 899             case 9:
 900                 if (season1Counter + season2Counter + season3Counter >= 2 && Integer.parseInt(data.get(5)) >= 2) {
 901                     awardText += "IASAS Scholar to be awarded if GPA is high honor roll";
 902                 }
 903                 break;
 904             case 10:
 905 
 906             case 11:
 907 
 908             case 12:
 909         }
 910         
 911 
 912 
 913     }                                           
 914 
 915     private void jvRBActionPerformed(java.awt.event.ActionEvent evt) {                                     
 916         // TODO add your handling code here:
 917         isIASASLabel.setVisible(false);
 918         isIASAScheckBox.setVisible(false);
 919     }                                    
 920 
 921     private void varsityRBActionPerformed(java.awt.event.ActionEvent evt) {                                          
 922         // TODO add your handling code here:
 923         isIASASLabel.setVisible(true);
 924         isIASAScheckBox.setVisible(true);
 925     }                                         
 926 
 927     private void clearRosterButtonActionPerformed(java.awt.event.ActionEvent evt) {                                                  
 928         // TODO add your handling code here:
 929         int input = JOptionPane.showConfirmDialog(this, "WARNING!!! This will clear all rosters and associated data."
 930                 + "\nAre you sure you wish to proceed?");
 931         if (input == 0) {
 932             c.clearVarsityMaleFile();
 933             c.clearVarsityFemaleFile();
 934             c.clearJVmaleFile();
 935             c.clearJVfemaleFile();
 936 
 937         }
 938 
 939     }                                                 
 940 
 941     private void displayAllRostersButtonActionPerformed(java.awt.event.ActionEvent evt) {                                                        
 942         // TODO add your handling code here:
 943 
 944         //Adjusting the display table to show the rosters.
 945         //Ideally, this occurs after the rosters have been sorted.
 946         ArrayList<Roster> holder1 = new ArrayList<>();
 947         ArrayList<Roster> holder2 = new ArrayList<>();
 948         ArrayList<Roster> holder3 = new ArrayList<>();
 949         ArrayList<Roster> holder4 = new ArrayList<>();
 950         int row = 0;
 951         if (c.checkVarsityMaleFileCreated() && c.checkVarsityMaleFileWritten()) {
 952             System.out.println("check");
 953             holder1 = c.getListVarsityMale();
 954 
 955             for (int i = 0; i < holder1.size(); i++) {
 956                 displayTable1.setValueAt(holder1.get(i).getSeason(), row, 0);
 957                 displayTable1.setValueAt(holder1.get(i).getSport(), row, 1);
 958                 displayTable1.setValueAt(holder1.get(i).getYear(), row, 2);
 959                 displayTable1.setValueAt(holder1.get(i).getIsVarsity(), row, 3);
 960                 displayTable1.setValueAt("Male", row, 4);
 961                 row++;
 962             }
 963         }
 964 
 965         if (c.checkVarsityFemaleFileCreated() && c.checkVarsityFemaleFileWritten()) {
 966             System.out.println("check2");
 967             holder2 = c.getListVarsityFemale();
 968 
 969             for (int i = 0; i < holder2.size(); i++) {
 970                 displayTable1.setValueAt(holder2.get(i).getSeason(), row, 0);
 971                 displayTable1.setValueAt(holder2.get(i).getSport(), row, 1);
 972                 displayTable1.setValueAt(holder2.get(i).getYear(), row, 2);
 973                 displayTable1.setValueAt(holder2.get(i).getIsVarsity(), row, 3);
 974                 displayTable1.setValueAt("Female", row, 4);
 975                 row++;
 976             }
 977         }
 978 
 979         if (c.checkJVmaleFileCreated() && c.checkJVmaleFileWritten()) {
 980             holder3 = c.getListJVmale();
 981 
 982             for (int i = 0; i < holder3.size(); i++) {
 983                 displayTable1.setValueAt(holder3.get(i).getSeason(), row, 0);
 984                 displayTable1.setValueAt(holder3.get(i).getSport(), row, 1);
 985                 displayTable1.setValueAt(holder3.get(i).getYear(), row, 2);
 986                 displayTable1.setValueAt(holder3.get(i).getIsVarsity(), row, 3);
 987                 displayTable1.setValueAt("Male", row, 4);
 988                 row++;
 989             }
 990         }
 991 
 992         if (c.checkJVfemaleFileCreated() && c.checkJVfemaleFileWritten()) {
 993             holder4 = c.getListJVfemale();
 994 
 995             for (int i = 0; i < holder4.size(); i++) {
 996                 displayTable1.setValueAt(holder4.get(i).getSeason(), row, 0);
 997                 displayTable1.setValueAt(holder4.get(i).getSport(), row, 1);
 998                 displayTable1.setValueAt(holder4.get(i).getYear(), row, 2);
 999                 displayTable1.setValueAt(holder4.get(i).getIsVarsity(), row, 3);
1000                 displayTable1.setValueAt("Female", row, 4);
1001                 row++;
1002             }
1003         }
1004 //        
1005 
1006 
1007     }                                                       
1008 
1009     private void seasonComboBox1ItemStateChanged(java.awt.event.ItemEvent evt) {                                                 
1010         // TODO add your handling code here:
1011         checkSeasonTab1();
1012     }                                                
1013 
1014     private void clearTableButtonActionPerformed(java.awt.event.ActionEvent evt) {                                                 
1015         // TODO add your handling code here:
1016         displayTable1.setModel(new javax.swing.table.DefaultTableModel(
1017                 new Object[][]{
1018                     {null, null, null, null, null},
1019                     {null, null, null, null, null},
1020                     {null, null, null, null, null},
1021                     {null, null, null, null, null}
1022                 },
1023                 new String[]{
1024                     "Season", "Sport", "Year", "Varsity", "Gender"
1025                 }
1026         ));
1027     }                                                
1028 
1029     private void showAwardsButtonActionPerformed(java.awt.event.ActionEvent evt) {                                                 
1030         // TODO add your handling code here:
1031         JOptionPane.showMessageDialog(this, awardText);
1032     }                                                
1033 
1034     private void sortBySportButtonActionPerformed(java.awt.event.ActionEvent evt) {                                                  
1035         // TODO add your handling code here:
1036         sortJustBySport();
1037         displayAllRostersButtonActionPerformed(evt);
1038     }                                                 
1039 
1040     private void sortByYearButtonActionPerformed(java.awt.event.ActionEvent evt) {                                                 
1041         // TODO add your handling code here:
1042         sortJustByYear();
1043         displayAllRostersButtonActionPerformed(evt);
1044     }                                                
1045 
1046     /**
1047      * @param args the command line arguments
1048      */
1049     public static void main(String args[]) {
1050         /* Set the Nimbus look and feel */
1051         //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
1052         /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
1053          * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
1054          */
1055         try {
1056             for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
1057                 if ("Nimbus".equals(info.getName())) {
1058                     javax.swing.UIManager.setLookAndFeel(info.getClassName());
1059                     break;
1060                 }
1061             }
1062         } catch (ClassNotFoundException ex) {
1063             java.util.logging.Logger.getLogger(MainGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
1064         } catch (InstantiationException ex) {
1065             java.util.logging.Logger.getLogger(MainGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
1066         } catch (IllegalAccessException ex) {
1067             java.util.logging.Logger.getLogger(MainGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
1068         } catch (javax.swing.UnsupportedLookAndFeelException ex) {
1069             java.util.logging.Logger.getLogger(MainGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
1070         }
1071         //</editor-fold>
1072         //</editor-fold>
1073 
1074         /* Create and display the form */
1075         java.awt.EventQueue.invokeLater(new Runnable() {
1076             public void run() {
1077                 new MainGUI().setVisible(true);
1078             }
1079         });
1080     }
1081 
1082     // Variables declaration - do not modify                     
1083     private javax.swing.JToggleButton clearRosterButton;
1084     private javax.swing.JButton clearTableButton;
1085     private javax.swing.JButton displayAllRostersButton;
1086     private javax.swing.JTable displayTable1;
1087     private javax.swing.JButton enterButton;
1088     private javax.swing.JRadioButton femaleRB;
1089     private javax.swing.JLabel firstNameLabel1;
1090     private javax.swing.JTextField fnField1;
1091     private javax.swing.JTextField fnField2;
1092     private javax.swing.ButtonGroup genderButtonGroup;
1093     private javax.swing.JLabel genderLabel1;
1094     private javax.swing.JComboBox<String> gradeComboBox1;
1095     private javax.swing.JLabel gradeLabel1;
1096     private javax.swing.JLabel isIASASLabel;
1097     private javax.swing.JCheckBox isIASAScheckBox;
1098     private javax.swing.JInternalFrame jInternalFrame1;
1099     private javax.swing.JLabel jLabel10;
1100     private javax.swing.JLayeredPane jLayeredPane1;
1101     private javax.swing.JPanel jPanel1;
1102     private javax.swing.JPanel jPanel2;
1103     private javax.swing.JPanel jPanel3;
1104     private javax.swing.JPanel jPanel4;
1105     private javax.swing.JScrollPane jScrollPane1;
1106     private javax.swing.JScrollPane jScrollPane2;
1107     private javax.swing.JSeparator jSeparator1;
1108     private javax.swing.JRadioButton jvRB;
1109     private javax.swing.JLabel lastNameLabel1;
1110     private javax.swing.JLabel lastNameLabel2;
1111     private javax.swing.JLabel levelLabel1;
1112     private javax.swing.JTextField lnField1;
1113     private javax.swing.JTextField lnField2;
1114     private javax.swing.JRadioButton maleRB;
1115     private javax.swing.JButton nextPlayerButton;
1116     private javax.swing.JTextArea playerDisplayArea;
1117     private javax.swing.JLabel playerLabel1;
1118     private javax.swing.JComboBox<String> positionComboBox1;
1119     private javax.swing.JLabel positionLabel1;
1120     private javax.swing.JTabbedPane searchPlayerPane;
1121     private javax.swing.JComboBox<String> seasonComboBox1;
1122     private javax.swing.JLabel seasonLabel1;
1123     private javax.swing.JButton showAwardsButton;
1124     private javax.swing.JButton sortBySeasonButton;
1125     private javax.swing.JButton sortBySportButton;
1126     private javax.swing.JButton sortByYearButton;
1127     private javax.swing.JComboBox<String> sportComboBox1;
1128     private javax.swing.JLabel sportLabel1;
1129     private javax.swing.JButton sumbitRosterButton;
1130     private javax.swing.ButtonGroup varsityJVbuttonGroup;
1131     private javax.swing.JRadioButton varsityRB;
1132     private javax.swing.JComboBox<String> yearComboBox1;
1133     private javax.swing.JLabel yearLabel1;
1134     // End of variables declaration                   
1135 
1136 }
1137