@SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jDialog1 = new javax.swing.JDialog();
        jDialog2 = new javax.swing.JDialog();
        jComboBox1 = new javax.swing.JComboBox();
        JButton jButton1 = new JButton();
        JButton jButton2 = new JButton();

        final FileFilter csv = new FileFilter() {
            @Override
            public boolean accept(File f) {
                return f.getName().endsWith("csv");
            }

            @Override
            public String getDescription() {
                return "Comma-separated value file";
            }
        };

        jFileChooser1 = new javax.swing.JFileChooser();
        jFileChooser1.setFileSelectionMode(JFileChooser.FILES_ONLY);
        jFileChooser1.setFileFilter(csv);

        JTabbedPane jTabbedPane1 = new JTabbedPane();
        studentInfo2 = new StudentInfo();
        AdvisingReport advingReport1 = new AdvisingReport();
        GradReport gradReport1 = new GradReport();
        JMenuBar jMenuBar1 = new JMenuBar();
        JMenu jMenu1 = new JMenu();
        JMenuItem jMenuItem1 = new JMenuItem();
        JMenuItem jMenuItem3 = new JMenuItem();
        JMenuItem jMenuItem2 = new JMenuItem();
        JMenuItem jMenuItem4 = new JMenuItem();
        JMenuItem jMenuItem5 = new JMenuItem();
        JMenuItem jMenuItem6 = new JMenuItem();

        jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(students.getNames()));

        jButton1.setText("Delete");
        jButton1.addActionListener(evt -> {
            students.deleteStudent((String) jComboBox1.getSelectedItem());
            jDialog1.setVisible(false);
            studentInfo2.loadList();
        });

        jButton2.setText("Export");
        jButton2.addActionListener(evt -> {
            StudentList ex = new StudentList();
            Student s = students.findStudent((String) jComboBox1.getSelectedItem());
            ex.add(s);
            int returnVal = jFileChooser1.showSaveDialog(null);
            if (returnVal == JFileChooser.APPROVE_OPTION) {
                File f = jFileChooser1.getSelectedFile();
                if (!f.getAbsolutePath().endsWith(".csv") && jFileChooser1.getFileFilter().equals(csv)) {
                    f = new File(f.getAbsolutePath().concat(".csv"));
                }
                FileIO.writeFile(f.getPath(), ex);
            }
            jDialog2.setVisible(false);
            studentInfo2.loadList();
        });

        javax.swing.GroupLayout jDialog1Layout = new javax.swing.GroupLayout(jDialog1.getContentPane());
        jDialog1.getContentPane().setLayout(jDialog1Layout);
        jDialog1Layout.setHorizontalGroup(
                jDialog1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jDialog1Layout.createSequentialGroup()
                                .addGroup(jDialog1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jDialog1Layout.createSequentialGroup()
                                                .addGap(145, 145, 145)
                                                .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGroup(jDialog1Layout.createSequentialGroup()
                                                .addGap(145, 145, 145)
                                                .addComponent(jButton1)))
                                .addContainerGap(175, Short.MAX_VALUE))
        );
        jDialog1Layout.setVerticalGroup(
                jDialog1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jDialog1Layout.createSequentialGroup()
                                .addGap(20, 20, 20)
                                .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(jButton1)
                                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jDialog2Layout = new javax.swing.GroupLayout(jDialog2.getContentPane());
        jDialog2.getContentPane().setLayout(jDialog2Layout);
        jDialog2Layout.setHorizontalGroup(
                jDialog2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jDialog2Layout.createSequentialGroup()
                                .addGroup(jDialog2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jDialog2Layout.createSequentialGroup()
                                                .addGap(145, 145, 145)
                                                .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGroup(jDialog2Layout.createSequentialGroup()
                                                .addGap(145, 145, 145)
                                                .addComponent(jButton2)))
                                .addContainerGap(175, Short.MAX_VALUE))
        );
        jDialog2Layout.setVerticalGroup(
                jDialog2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jDialog2Layout.createSequentialGroup()
                                .addGap(20, 20, 20)
                                .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(jButton2)
                                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jTabbedPane1.addTab("Student Information", studentInfo2);
        jTabbedPane1.addTab("Advising Report", advingReport1);
        jTabbedPane1.addTab("Graduation Application Report", gradReport1);

        jMenu1.setText("File");

        jMenuItem1.setText("Import Students");
        jMenuItem1.addActionListener(evt -> {
            jFileChooser1.setApproveButtonText("Import");
            int returnVal = jFileChooser1.showOpenDialog(null);
            if (returnVal == JFileChooser.APPROVE_OPTION) {
                File f = jFileChooser1.getSelectedFile();
                students.addAll(FileIO.readFile(f));
            }
            students.saveInfo();
            studentInfo2.loadList();
        });
        jMenu1.add(jMenuItem1);

        jMenuItem3.setText("Export Students");
        jMenuItem3.addActionListener(evt -> {
            int returnVal = jFileChooser1.showSaveDialog(null);
            if (returnVal == JFileChooser.APPROVE_OPTION) {
                File f = jFileChooser1.getSelectedFile();
                if (!f.getAbsolutePath().endsWith(".csv") && jFileChooser1.getFileFilter().equals(csv)) {
                    f = new File(f.getAbsolutePath().concat(".csv"));
                }
                FileIO.writeFile(f.getPath(), students);
            }
            studentInfo2.loadList();
        });
        jMenu1.add(jMenuItem3);

        jMenuItem2.setText("Add Student");
        jMenuItem2.addActionListener(studentInfo2::jButton3ActionPerformed);
        jMenu1.add(jMenuItem2);

        jMenuItem4.setText("Remove Student");
        jMenuItem4.addActionListener(evt -> {
            jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(students.getNames()));
            jDialog1.setBounds(100, 100, 400, 200);
            jDialog1.setVisible(true);
            students.saveInfo();
        });
        jMenu1.add(jMenuItem4);

        jMenuItem5.setText("Remove All Students");
        jMenuItem5.addActionListener(evt -> {
            students.clear();
            students.saveInfo();
            studentInfo2.loadList();
        });
        jMenu1.add(jMenuItem5);

        jMenuItem6.setText("Export Student");
        jMenuItem6.addActionListener(evt -> {
            jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(students.getNames()));
            jDialog2.setBounds(100, 100, 400, 200);
            jDialog2.setVisible(true);
            students.saveInfo();
        });
        jMenu1.add(jMenuItem6);

        jMenuBar1.add(jMenu1);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 595, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 379, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents