com.gsecs.GSECSFrame.java Source code

Java tutorial

Introduction

Here is the source code for com.gsecs.GSECSFrame.java

Source

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.gsecs;

import com.user.exp.DataSourceException;
import com.user.model.CourseModel;
import com.user.model.CourseSectionModel;
import com.user.model.DegreePlanModel;
import com.user.model.FacultyModel;
import com.user.model.GradSchoolModel;
import com.user.model.RoomModel;
import com.user.model.SemesterModel;
import com.user.model.StudentModel;
import com.user.model.UserModel;
import com.user.model.bean.CourseBean;
import com.user.model.bean.CourseSectionBean;
import com.user.model.bean.DegreePlanBean;
import com.user.model.bean.FacultyBean;
import com.user.model.bean.RoomBean;
import com.user.model.bean.SchoolBean;
import com.user.model.bean.SemesterBean;
import com.user.model.bean.StudentBean;
import com.user.model.bean.StudentCourseBean;
import com.user.model.bean.UserBean;
import java.io.FileInputStream;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
import net.proteanit.sql.DbUtils;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.DataFormatter;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;

/**
 *
 * @author V
 */
public class GSECSFrame extends javax.swing.JFrame {

    /**
    * Creates new form GSECSFrame
    */
    public GSECSFrame() {
        initComponents();

    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        mainPanel = new javax.swing.JDesktopPane();
        MenuBar = new javax.swing.JMenuBar();
        GradSchoolMenu = new javax.swing.JMenu();
        schoolAddMenuItem = new javax.swing.JCheckBoxMenuItem();
        schoolUpdateMenuItem = new javax.swing.JMenuItem();
        schoolDeleteMenuItem = new javax.swing.JMenuItem();
        importSchoolData = new javax.swing.JMenuItem();
        FacultyMenu = new javax.swing.JMenu();
        facultyAddMenuItem = new javax.swing.JCheckBoxMenuItem();
        facultyUpdateMenuItem1 = new javax.swing.JMenuItem();
        facultyDeleteMenuItem1 = new javax.swing.JMenuItem();
        facultyImportMenuItem = new javax.swing.JMenuItem();
        CourseMenu = new javax.swing.JMenu();
        courseAddMenuItem1 = new javax.swing.JCheckBoxMenuItem();
        courseUpdateMenuItem = new javax.swing.JMenuItem();
        courseDeleteMenuItem = new javax.swing.JMenuItem();
        importCourseMenuItem = new javax.swing.JMenuItem();
        CourseSectionMenu = new javax.swing.JMenu();
        courseSectionAddMenuItem = new javax.swing.JCheckBoxMenuItem();
        courseSectionUpdateMenuItem = new javax.swing.JMenuItem();
        courseSectionDeleteMenuItem = new javax.swing.JMenuItem();
        importcourseSectionMenuItem = new javax.swing.JMenuItem();
        degreePlanMenu = new javax.swing.JMenu();
        degreePlanAddButton = new javax.swing.JCheckBoxMenuItem();
        degreePlanUpdateButton = new javax.swing.JMenuItem();
        degreePlanDeleteButton = new javax.swing.JMenuItem();
        importDegreePlanMenuItem = new javax.swing.JMenuItem();
        studentMenu = new javax.swing.JMenu();
        studentAddMenuItem = new javax.swing.JCheckBoxMenuItem();
        studentUpdateMenuItem = new javax.swing.JMenuItem();
        studentDeleteMenuItem = new javax.swing.JMenuItem();
        importStudentMenuItem = new javax.swing.JMenuItem();
        studentCourseMenu = new javax.swing.JMenu();
        studentCourseAddMenuItem = new javax.swing.JCheckBoxMenuItem();
        studentCourseUpdateMenuItem = new javax.swing.JMenuItem();
        studentCourseDeleteMenuItem = new javax.swing.JMenuItem();
        importStudentCourseMenuItem = new javax.swing.JMenuItem();
        SemesterMenu = new javax.swing.JMenu();
        SemesterAddMenuItem = new javax.swing.JCheckBoxMenuItem();
        SemesterUpdateMenuItem = new javax.swing.JMenuItem();
        SemesterDeleteMenuItem = new javax.swing.JMenuItem();
        importSemesterMenuItem = new javax.swing.JMenuItem();
        RoomsMenu = new javax.swing.JMenu();
        AddRoomMenuItem = new javax.swing.JCheckBoxMenuItem();
        UpdateRoomMenuItem = new javax.swing.JMenuItem();
        DeleteRoomMenuItem = new javax.swing.JMenuItem();
        ImportRoomMenuItem = new javax.swing.JMenuItem();
        UsersMenu = new javax.swing.JMenu();
        AddUsersMenuItem = new javax.swing.JCheckBoxMenuItem();
        UpdateUsersMenuItem = new javax.swing.JMenuItem();
        DeleteUsersMenuItem = new javax.swing.JMenuItem();
        ImportUsersMenuItem = new javax.swing.JMenuItem();
        GenerateSchedule = new javax.swing.JMenu();
        ReportsMenu = new javax.swing.JMenu();
        ScheduleReportMenuItem = new javax.swing.JMenuItem();
        degreePlanReportMenuItem = new javax.swing.JMenuItem();
        StudentReportMenuItem = new javax.swing.JMenuItem();
        TestSchedule = new javax.swing.JMenu();
        logOutMenuButton = new javax.swing.JMenu();

        jLabel1.setText("jLabel1");

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setBackground(new java.awt.Color(153, 153, 255));

        mainPanel.setBackground(new java.awt.Color(255, 255, 255));
        mainPanel.setForeground(new java.awt.Color(255, 255, 255));

        javax.swing.GroupLayout mainPanelLayout = new javax.swing.GroupLayout(mainPanel);
        mainPanel.setLayout(mainPanelLayout);
        mainPanelLayout.setHorizontalGroup(mainPanelLayout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 968, Short.MAX_VALUE));
        mainPanelLayout.setVerticalGroup(mainPanelLayout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 283, Short.MAX_VALUE));

        getContentPane().add(mainPanel, java.awt.BorderLayout.CENTER);

        GradSchoolMenu.setBackground(new java.awt.Color(102, 102, 255));
        GradSchoolMenu.setForeground(new java.awt.Color(51, 51, 255));
        GradSchoolMenu.setText("GradSchool");
        GradSchoolMenu.addAncestorListener(new javax.swing.event.AncestorListener() {
            public void ancestorMoved(javax.swing.event.AncestorEvent evt) {
                GradSchoolMenuAncestorMoved(evt);
            }

            public void ancestorAdded(javax.swing.event.AncestorEvent evt) {
            }

            public void ancestorRemoved(javax.swing.event.AncestorEvent evt) {
            }
        });

        schoolAddMenuItem.setSelected(true);
        schoolAddMenuItem.setText("Add");
        schoolAddMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                schoolAddMenuItemActionPerformed(evt);
            }
        });
        GradSchoolMenu.add(schoolAddMenuItem);

        schoolUpdateMenuItem.setText("Update");
        schoolUpdateMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                schoolUpdateMenuItemActionPerformed(evt);
            }
        });
        GradSchoolMenu.add(schoolUpdateMenuItem);

        schoolDeleteMenuItem.setText("Delete");
        schoolDeleteMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                schoolDeleteMenuItemActionPerformed(evt);
            }
        });
        GradSchoolMenu.add(schoolDeleteMenuItem);

        importSchoolData.setText("Import");
        importSchoolData.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                importSchoolDataActionPerformed(evt);
            }
        });
        GradSchoolMenu.add(importSchoolData);

        MenuBar.add(GradSchoolMenu);

        FacultyMenu.setBackground(new java.awt.Color(102, 102, 255));
        FacultyMenu.setForeground(new java.awt.Color(51, 51, 255));
        FacultyMenu.setText("Faculty");
        FacultyMenu.addAncestorListener(new javax.swing.event.AncestorListener() {
            public void ancestorMoved(javax.swing.event.AncestorEvent evt) {
                FacultyMenuAncestorMoved(evt);
            }

            public void ancestorAdded(javax.swing.event.AncestorEvent evt) {
            }

            public void ancestorRemoved(javax.swing.event.AncestorEvent evt) {
            }
        });

        facultyAddMenuItem.setSelected(true);
        facultyAddMenuItem.setText("Add");
        facultyAddMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                facultyAddMenuItemActionPerformed(evt);
            }
        });
        FacultyMenu.add(facultyAddMenuItem);

        facultyUpdateMenuItem1.setText("Update");
        facultyUpdateMenuItem1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                facultyUpdateMenuItem1ActionPerformed(evt);
            }
        });
        FacultyMenu.add(facultyUpdateMenuItem1);

        facultyDeleteMenuItem1.setText("Delete");
        facultyDeleteMenuItem1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                facultyDeleteMenuItem1ActionPerformed(evt);
            }
        });
        FacultyMenu.add(facultyDeleteMenuItem1);

        facultyImportMenuItem.setText("Import");
        facultyImportMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                facultyImportMenuItemActionPerformed(evt);
            }
        });
        FacultyMenu.add(facultyImportMenuItem);

        MenuBar.add(FacultyMenu);

        CourseMenu.setBackground(new java.awt.Color(102, 102, 255));
        CourseMenu.setForeground(new java.awt.Color(51, 51, 255));
        CourseMenu.setText("Course");
        CourseMenu.addAncestorListener(new javax.swing.event.AncestorListener() {
            public void ancestorMoved(javax.swing.event.AncestorEvent evt) {
                CourseMenuAncestorMoved(evt);
            }

            public void ancestorAdded(javax.swing.event.AncestorEvent evt) {
            }

            public void ancestorRemoved(javax.swing.event.AncestorEvent evt) {
            }
        });

        courseAddMenuItem1.setSelected(true);
        courseAddMenuItem1.setText("Add");
        courseAddMenuItem1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                courseAddMenuItem1ActionPerformed(evt);
            }
        });
        CourseMenu.add(courseAddMenuItem1);

        courseUpdateMenuItem.setText("Update");
        courseUpdateMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                courseUpdateMenuItemActionPerformed(evt);
            }
        });
        CourseMenu.add(courseUpdateMenuItem);

        courseDeleteMenuItem.setText("Delete");
        courseDeleteMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                courseDeleteMenuItemActionPerformed(evt);
            }
        });
        CourseMenu.add(courseDeleteMenuItem);

        importCourseMenuItem.setText("Import");
        importCourseMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                importCourseMenuItemActionPerformed(evt);
            }
        });
        CourseMenu.add(importCourseMenuItem);

        MenuBar.add(CourseMenu);

        CourseSectionMenu.setBackground(new java.awt.Color(102, 102, 255));
        CourseSectionMenu.setForeground(new java.awt.Color(51, 51, 255));
        CourseSectionMenu.setText("CourseSection");
        CourseSectionMenu.addAncestorListener(new javax.swing.event.AncestorListener() {
            public void ancestorMoved(javax.swing.event.AncestorEvent evt) {
                CourseSectionMenuAncestorMoved(evt);
            }

            public void ancestorAdded(javax.swing.event.AncestorEvent evt) {
            }

            public void ancestorRemoved(javax.swing.event.AncestorEvent evt) {
            }
        });

        courseSectionAddMenuItem.setSelected(true);
        courseSectionAddMenuItem.setText("Add");
        courseSectionAddMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                courseSectionAddMenuItemActionPerformed(evt);
            }
        });
        CourseSectionMenu.add(courseSectionAddMenuItem);

        courseSectionUpdateMenuItem.setText("Update");
        courseSectionUpdateMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                courseSectionUpdateMenuItemActionPerformed(evt);
            }
        });
        CourseSectionMenu.add(courseSectionUpdateMenuItem);

        courseSectionDeleteMenuItem.setText("Delete");
        courseSectionDeleteMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                courseSectionDeleteMenuItemActionPerformed(evt);
            }
        });
        CourseSectionMenu.add(courseSectionDeleteMenuItem);

        importcourseSectionMenuItem.setText("Import");
        importcourseSectionMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                importcourseSectionMenuItemActionPerformed(evt);
            }
        });
        CourseSectionMenu.add(importcourseSectionMenuItem);

        MenuBar.add(CourseSectionMenu);

        degreePlanMenu.setBackground(new java.awt.Color(102, 102, 255));
        degreePlanMenu.setForeground(new java.awt.Color(51, 51, 255));
        degreePlanMenu.setText("DegreePlan");
        degreePlanMenu.addAncestorListener(new javax.swing.event.AncestorListener() {
            public void ancestorMoved(javax.swing.event.AncestorEvent evt) {
                degreePlanMenuAncestorMoved(evt);
            }

            public void ancestorAdded(javax.swing.event.AncestorEvent evt) {
            }

            public void ancestorRemoved(javax.swing.event.AncestorEvent evt) {
            }
        });

        degreePlanAddButton.setSelected(true);
        degreePlanAddButton.setText("Add");
        degreePlanAddButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                degreePlanAddButtonActionPerformed(evt);
            }
        });
        degreePlanMenu.add(degreePlanAddButton);

        degreePlanUpdateButton.setText("Update");
        degreePlanUpdateButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                degreePlanUpdateButtonActionPerformed(evt);
            }
        });
        degreePlanMenu.add(degreePlanUpdateButton);

        degreePlanDeleteButton.setText("Delete");
        degreePlanDeleteButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                degreePlanDeleteButtonActionPerformed(evt);
            }
        });
        degreePlanMenu.add(degreePlanDeleteButton);

        importDegreePlanMenuItem.setText("Import");
        importDegreePlanMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                importDegreePlanMenuItemActionPerformed(evt);
            }
        });
        degreePlanMenu.add(importDegreePlanMenuItem);

        MenuBar.add(degreePlanMenu);

        studentMenu.setBackground(new java.awt.Color(102, 102, 255));
        studentMenu.setForeground(new java.awt.Color(51, 51, 255));
        studentMenu.setText("Student");
        studentMenu.addAncestorListener(new javax.swing.event.AncestorListener() {
            public void ancestorMoved(javax.swing.event.AncestorEvent evt) {
                studentMenuAncestorMoved(evt);
            }

            public void ancestorAdded(javax.swing.event.AncestorEvent evt) {
            }

            public void ancestorRemoved(javax.swing.event.AncestorEvent evt) {
            }
        });

        studentAddMenuItem.setSelected(true);
        studentAddMenuItem.setText("Add");
        studentAddMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                studentAddMenuItemActionPerformed(evt);
            }
        });
        studentMenu.add(studentAddMenuItem);

        studentUpdateMenuItem.setText("Update");
        studentUpdateMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                studentUpdateMenuItemActionPerformed(evt);
            }
        });
        studentMenu.add(studentUpdateMenuItem);

        studentDeleteMenuItem.setText("Delete");
        studentDeleteMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                studentDeleteMenuItemActionPerformed(evt);
            }
        });
        studentMenu.add(studentDeleteMenuItem);

        importStudentMenuItem.setText("Import");
        importStudentMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                importStudentMenuItemActionPerformed(evt);
            }
        });
        studentMenu.add(importStudentMenuItem);

        MenuBar.add(studentMenu);

        studentCourseMenu.setBackground(new java.awt.Color(102, 102, 255));
        studentCourseMenu.setForeground(new java.awt.Color(51, 51, 255));
        studentCourseMenu.setText("StudentCourse");
        studentCourseMenu.addAncestorListener(new javax.swing.event.AncestorListener() {
            public void ancestorMoved(javax.swing.event.AncestorEvent evt) {
                studentCourseMenuAncestorMoved(evt);
            }

            public void ancestorAdded(javax.swing.event.AncestorEvent evt) {
            }

            public void ancestorRemoved(javax.swing.event.AncestorEvent evt) {
            }
        });

        studentCourseAddMenuItem.setSelected(true);
        studentCourseAddMenuItem.setText("Add");
        studentCourseAddMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                studentCourseAddMenuItemActionPerformed(evt);
            }
        });
        studentCourseMenu.add(studentCourseAddMenuItem);

        studentCourseUpdateMenuItem.setText("Update");
        studentCourseUpdateMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                studentCourseUpdateMenuItemActionPerformed(evt);
            }
        });
        studentCourseMenu.add(studentCourseUpdateMenuItem);

        studentCourseDeleteMenuItem.setText("Delete");
        studentCourseDeleteMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                studentCourseDeleteMenuItemActionPerformed(evt);
            }
        });
        studentCourseMenu.add(studentCourseDeleteMenuItem);

        importStudentCourseMenuItem.setText("Import");
        importStudentCourseMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                importStudentCourseMenuItemActionPerformed(evt);
            }
        });
        studentCourseMenu.add(importStudentCourseMenuItem);

        MenuBar.add(studentCourseMenu);

        SemesterMenu.setBackground(new java.awt.Color(102, 102, 255));
        SemesterMenu.setForeground(new java.awt.Color(51, 51, 255));
        SemesterMenu.setText("Semester");
        SemesterMenu.addAncestorListener(new javax.swing.event.AncestorListener() {
            public void ancestorMoved(javax.swing.event.AncestorEvent evt) {
                SemesterMenuAncestorMoved(evt);
            }

            public void ancestorAdded(javax.swing.event.AncestorEvent evt) {
            }

            public void ancestorRemoved(javax.swing.event.AncestorEvent evt) {
            }
        });

        SemesterAddMenuItem.setSelected(true);
        SemesterAddMenuItem.setText("Add");
        SemesterAddMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SemesterAddMenuItemActionPerformed(evt);
            }
        });
        SemesterMenu.add(SemesterAddMenuItem);

        SemesterUpdateMenuItem.setText("Update");
        SemesterUpdateMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SemesterUpdateMenuItemActionPerformed(evt);
            }
        });
        SemesterMenu.add(SemesterUpdateMenuItem);

        SemesterDeleteMenuItem.setText("Delete");
        SemesterDeleteMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SemesterDeleteMenuItemActionPerformed(evt);
            }
        });
        SemesterMenu.add(SemesterDeleteMenuItem);

        importSemesterMenuItem.setText("Import");
        importSemesterMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                importSemesterMenuItemActionPerformed(evt);
            }
        });
        SemesterMenu.add(importSemesterMenuItem);

        MenuBar.add(SemesterMenu);

        RoomsMenu.setBackground(new java.awt.Color(102, 102, 255));
        RoomsMenu.setForeground(new java.awt.Color(0, 0, 204));
        RoomsMenu.setText("Rooms");
        RoomsMenu.addAncestorListener(new javax.swing.event.AncestorListener() {
            public void ancestorMoved(javax.swing.event.AncestorEvent evt) {
                RoomsMenuAncestorMoved(evt);
            }

            public void ancestorAdded(javax.swing.event.AncestorEvent evt) {
            }

            public void ancestorRemoved(javax.swing.event.AncestorEvent evt) {
            }
        });

        AddRoomMenuItem.setSelected(true);
        AddRoomMenuItem.setText("Add");
        AddRoomMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                AddRoomMenuItemActionPerformed(evt);
            }
        });
        RoomsMenu.add(AddRoomMenuItem);

        UpdateRoomMenuItem.setText("Update");
        UpdateRoomMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                UpdateRoomMenuItemActionPerformed(evt);
            }
        });
        RoomsMenu.add(UpdateRoomMenuItem);

        DeleteRoomMenuItem.setText("Delete");
        DeleteRoomMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                DeleteRoomMenuItemActionPerformed(evt);
            }
        });
        RoomsMenu.add(DeleteRoomMenuItem);

        ImportRoomMenuItem.setText("Import");
        ImportRoomMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ImportRoomMenuItemActionPerformed(evt);
            }
        });
        RoomsMenu.add(ImportRoomMenuItem);

        MenuBar.add(RoomsMenu);

        UsersMenu.setBackground(new java.awt.Color(102, 102, 255));
        UsersMenu.setForeground(new java.awt.Color(0, 0, 204));
        UsersMenu.setText("Users");
        UsersMenu.addAncestorListener(new javax.swing.event.AncestorListener() {
            public void ancestorMoved(javax.swing.event.AncestorEvent evt) {
                UsersMenuAncestorMoved(evt);
            }

            public void ancestorAdded(javax.swing.event.AncestorEvent evt) {
            }

            public void ancestorRemoved(javax.swing.event.AncestorEvent evt) {
            }
        });

        AddUsersMenuItem.setSelected(true);
        AddUsersMenuItem.setText("Add");
        AddUsersMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                AddUsersMenuItemActionPerformed(evt);
            }
        });
        UsersMenu.add(AddUsersMenuItem);

        UpdateUsersMenuItem.setText("Update");
        UpdateUsersMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                UpdateUsersMenuItemActionPerformed(evt);
            }
        });
        UsersMenu.add(UpdateUsersMenuItem);

        DeleteUsersMenuItem.setText("Delete");
        DeleteUsersMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                DeleteUsersMenuItemActionPerformed(evt);
            }
        });
        UsersMenu.add(DeleteUsersMenuItem);

        ImportUsersMenuItem.setText("Import");
        ImportUsersMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ImportUsersMenuItemActionPerformed(evt);
            }
        });
        UsersMenu.add(ImportUsersMenuItem);

        MenuBar.add(UsersMenu);

        GenerateSchedule.setBackground(new java.awt.Color(102, 102, 255));
        GenerateSchedule.setForeground(new java.awt.Color(51, 51, 255));
        GenerateSchedule.setText("GenerateSchedule");
        GenerateSchedule.addAncestorListener(new javax.swing.event.AncestorListener() {
            public void ancestorMoved(javax.swing.event.AncestorEvent evt) {
                GenerateScheduleAncestorMoved(evt);
            }

            public void ancestorAdded(javax.swing.event.AncestorEvent evt) {
            }

            public void ancestorRemoved(javax.swing.event.AncestorEvent evt) {
            }
        });
        GenerateSchedule.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                GenerateScheduleMouseClicked(evt);
            }
        });
        MenuBar.add(GenerateSchedule);

        ReportsMenu.setBackground(new java.awt.Color(102, 102, 255));
        ReportsMenu.setForeground(new java.awt.Color(51, 51, 255));
        ReportsMenu.setText("Reports");
        ReportsMenu.addAncestorListener(new javax.swing.event.AncestorListener() {
            public void ancestorMoved(javax.swing.event.AncestorEvent evt) {
                ReportsMenuAncestorMoved(evt);
            }

            public void ancestorAdded(javax.swing.event.AncestorEvent evt) {
            }

            public void ancestorRemoved(javax.swing.event.AncestorEvent evt) {
            }
        });
        ReportsMenu.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                ReportsMenuMouseClicked(evt);
            }
        });

        ScheduleReportMenuItem.setText("ScheduleReport");
        ScheduleReportMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ScheduleReportMenuItemActionPerformed(evt);
            }
        });
        ReportsMenu.add(ScheduleReportMenuItem);

        degreePlanReportMenuItem.setText("DegreePlan Report");
        degreePlanReportMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                degreePlanReportMenuItemActionPerformed(evt);
            }
        });
        ReportsMenu.add(degreePlanReportMenuItem);

        StudentReportMenuItem.setText("Student Report");
        StudentReportMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                StudentReportMenuItemActionPerformed(evt);
            }
        });
        ReportsMenu.add(StudentReportMenuItem);

        MenuBar.add(ReportsMenu);

        TestSchedule.setBackground(new java.awt.Color(102, 102, 255));
        TestSchedule.setForeground(new java.awt.Color(51, 51, 255));
        TestSchedule.setText("TestSchedule");
        TestSchedule.addAncestorListener(new javax.swing.event.AncestorListener() {
            public void ancestorMoved(javax.swing.event.AncestorEvent evt) {
                TestScheduleAncestorMoved(evt);
            }

            public void ancestorAdded(javax.swing.event.AncestorEvent evt) {
            }

            public void ancestorRemoved(javax.swing.event.AncestorEvent evt) {
            }
        });
        TestSchedule.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                TestScheduleMouseClicked(evt);
            }
        });
        MenuBar.add(TestSchedule);

        logOutMenuButton.setBackground(new java.awt.Color(0, 0, 204));
        logOutMenuButton.setForeground(new java.awt.Color(0, 0, 255));
        logOutMenuButton.setText("Logout");
        logOutMenuButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                logOutMenuButtonMouseClicked(evt);
            }
        });
        logOutMenuButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                logOutMenuButtonActionPerformed(evt);
            }
        });
        MenuBar.add(logOutMenuButton);

        setJMenuBar(MenuBar);

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

    private void UsersMenuAncestorMoved(javax.swing.event.AncestorEvent evt) {//GEN-FIRST:event_UsersMenuAncestorMoved
        // TODO add your handling code here:
    }//GEN-LAST:event_UsersMenuAncestorMoved

    private void AddUsersMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_AddUsersMenuItemActionPerformed
        // TODO add your handling code here:
        try {
            mainPanel.removeAll();
            mainPanel.repaint();
            UserJInternalFrame userFrame = new UserJInternalFrame();
            userFrame.loadDataIntoJTable();

            userFrame.getUsersMsgLabel().setText("");
            userFrame.getUserRegister().setVisible(true);
            userFrame.getUserUpdateButton().setVisible(false);
            userFrame.getUserDeleteButton().setVisible(false);

            mainPanel.add(userFrame);
            userFrame.setVisible(true);

        } catch (Exception exp) {
            JOptionPane.showMessageDialog(null, "Exception Raised " + exp);
        }
    }//GEN-LAST:event_AddUsersMenuItemActionPerformed

    private void schoolAddMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_schoolAddMenuItemActionPerformed
        // TODO add your handling code here:
        try {
            mainPanel.removeAll();
            mainPanel.repaint();
            GradSchoolJInternalFrame schoolFrame = new GradSchoolJInternalFrame();
            schoolFrame.getSchoolMsgLabel().setText("");
            schoolFrame.getAddSchoolButton().setVisible(true);
            schoolFrame.getUpdateSchoolButton().setVisible(false);
            schoolFrame.getDeleteSchoolButton().setVisible(false);
            //schoolFrame.getSchoolDataTable().setModel(DbUtils.resultSetToTableModel( new GradSchoolModel().getAllSchools()));
            schoolFrame.loadDataIntoJTable();
            mainPanel.add(schoolFrame);
            schoolFrame.setVisible(true);

        } catch (Exception exp) {
            JOptionPane.showMessageDialog(null, "Exception Raised " + exp);
        }

    }//GEN-LAST:event_schoolAddMenuItemActionPerformed

    private void GradSchoolMenuAncestorMoved(javax.swing.event.AncestorEvent evt) {//GEN-FIRST:event_GradSchoolMenuAncestorMoved
        // TODO add your handling code here:
    }//GEN-LAST:event_GradSchoolMenuAncestorMoved

    private void schoolUpdateMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_schoolUpdateMenuItemActionPerformed
        // TODO add your handling code here:
        try {
            mainPanel.removeAll();
            mainPanel.repaint();
            GradSchoolJInternalFrame schoolFrame = new GradSchoolJInternalFrame();
            schoolFrame.getSchoolMsgLabel().setText("");
            schoolFrame.getAddSchoolButton().setVisible(false);
            schoolFrame.getUpdateSchoolButton().setVisible(true);
            schoolFrame.getDeleteSchoolButton().setVisible(false);
            //schoolFrame.getSchoolDataTable().setModel(DbUtils.resultSetToTableModel( new GradSchoolModel().getAllSchools()));
            schoolFrame.loadDataIntoJTable();
            mainPanel.add(schoolFrame);
            schoolFrame.setVisible(true);

        } catch (Exception exp) {
            JOptionPane.showMessageDialog(null, "Exception Raised " + exp);
        }
    }//GEN-LAST:event_schoolUpdateMenuItemActionPerformed

    private void schoolDeleteMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_schoolDeleteMenuItemActionPerformed
        // TODO add your handling code here:
        try {
            mainPanel.removeAll();
            mainPanel.repaint();
            GradSchoolJInternalFrame schoolFrame = new GradSchoolJInternalFrame();
            schoolFrame.getSchoolMsgLabel().setText("");
            schoolFrame.getAddSchoolButton().setVisible(false);
            schoolFrame.getUpdateSchoolButton().setVisible(false);
            schoolFrame.getDeleteSchoolButton().setVisible(true);
            //schoolFrame.getSchoolDataTable().setModel(DbUtils.resultSetToTableModel( new GradSchoolModel().getAllSchools()));
            schoolFrame.loadDataIntoJTable();
            mainPanel.add(schoolFrame);
            schoolFrame.setVisible(true);

        } catch (Exception exp) {
            JOptionPane.showMessageDialog(null, "Exception Raised " + exp);
        }
    }//GEN-LAST:event_schoolDeleteMenuItemActionPerformed

    private void logOutMenuButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_logOutMenuButtonActionPerformed
        // TODO add your handling code here:
        this.dispose();
        new Login().setVisible(true);
    }//GEN-LAST:event_logOutMenuButtonActionPerformed

    private void logOutMenuButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_logOutMenuButtonMouseClicked
        // TODO add your handling code here:
        this.dispose();
        new Login().setVisible(true);
    }//GEN-LAST:event_logOutMenuButtonMouseClicked

    private void facultyAddMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_facultyAddMenuItemActionPerformed
        // TODO add your handling code here:

        try {
            mainPanel.removeAll();
            mainPanel.repaint();
            FacultyJInternalFrame facultyFrame = new FacultyJInternalFrame();
            facultyFrame.getFacultyMsgLabel().setText("");

            facultyFrame.getLblFirstName().setVisible(true);
            facultyFrame.getLblLastName().setVisible(true);
            facultyFrame.getLblDegree().setVisible(true);
            facultyFrame.getLblTitle().setVisible(true);
            facultyFrame.getLblDaysToTeach().setVisible(true);
            facultyFrame.getLblMaxLoadFall().setVisible(true);
            facultyFrame.getLblMaxLoadSpring().setVisible(true);
            facultyFrame.getLblMaxLoadSummer().setVisible(true);
            facultyFrame.getLblGradSchool().setVisible(true);

            facultyFrame.getFirstName().setVisible(true);
            facultyFrame.getLastName().setVisible(true);
            facultyFrame.getDegree().setVisible(true);
            facultyFrame.getTitleTextField().setVisible(true);
            facultyFrame.getDaysToTeach().setVisible(true);
            facultyFrame.getMaxLoadFall().setVisible(true);
            facultyFrame.getMaxLoadSpring().setVisible(true);
            facultyFrame.getMaxLoadSummer().setVisible(true);
            facultyFrame.getGradSchool().setVisible(true);

            facultyFrame.getAddFacultyButton().setVisible(true);
            facultyFrame.getUpdateFacultyButton().setVisible(false);
            facultyFrame.getDeleteFacultyButton().setVisible(false);
            //schoolFrame.getSchoolDataTable().setModel(DbUtils.resultSetToTableModel( new GradSchoolModel().getAllSchools()));
            facultyFrame.loadDataIntoJTable();
            mainPanel.add(facultyFrame);
            facultyFrame.setVisible(true);

        } catch (Exception exp) {
            JOptionPane.showMessageDialog(null, "Exception Raised " + exp);
        }

    }//GEN-LAST:event_facultyAddMenuItemActionPerformed

    private void facultyUpdateMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_facultyUpdateMenuItem1ActionPerformed
        // TODO add your handling code here:
        try {
            mainPanel.removeAll();
            mainPanel.repaint();
            FacultyJInternalFrame facultyFrame = new FacultyJInternalFrame();
            facultyFrame.getFacultyMsgLabel().setText("");

            facultyFrame.getLblFirstName().setVisible(true);
            facultyFrame.getLblLastName().setVisible(true);
            facultyFrame.getLblDegree().setVisible(true);
            facultyFrame.getLblTitle().setVisible(true);
            facultyFrame.getLblDaysToTeach().setVisible(true);
            facultyFrame.getLblMaxLoadFall().setVisible(true);
            facultyFrame.getLblMaxLoadSpring().setVisible(true);
            facultyFrame.getLblMaxLoadSummer().setVisible(true);
            facultyFrame.getLblGradSchool().setVisible(true);

            facultyFrame.getFirstName().setVisible(true);
            facultyFrame.getLastName().setVisible(true);
            facultyFrame.getDegree().setVisible(true);
            facultyFrame.getTitleTextField().setVisible(true);
            facultyFrame.getDaysToTeach().setVisible(true);
            facultyFrame.getMaxLoadFall().setVisible(true);
            facultyFrame.getMaxLoadSpring().setVisible(true);
            facultyFrame.getMaxLoadSummer().setVisible(true);
            facultyFrame.getGradSchool().setVisible(true);

            facultyFrame.getAddFacultyButton().setVisible(false);
            facultyFrame.getUpdateFacultyButton().setVisible(true);
            facultyFrame.getDeleteFacultyButton().setVisible(false);
            //schoolFrame.getSchoolDataTable().setModel(DbUtils.resultSetToTableModel( new GradSchoolModel().getAllSchools()));
            facultyFrame.loadDataIntoJTable();
            mainPanel.add(facultyFrame);
            facultyFrame.setVisible(true);

        } catch (Exception exp) {
            JOptionPane.showMessageDialog(null, "Exception Raised " + exp);
        }
    }//GEN-LAST:event_facultyUpdateMenuItem1ActionPerformed

    private void facultyDeleteMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_facultyDeleteMenuItem1ActionPerformed
        // TODO add your handling code here:
        try {
            mainPanel.removeAll();
            mainPanel.repaint();
            FacultyJInternalFrame facultyFrame = new FacultyJInternalFrame();
            facultyFrame.getFacultyMsgLabel().setText("");

            facultyFrame.getLblFirstName().setVisible(true);
            facultyFrame.getLblLastName().setVisible(false);
            facultyFrame.getLblDegree().setVisible(false);
            facultyFrame.getLblTitle().setVisible(false);
            facultyFrame.getLblDaysToTeach().setVisible(false);
            facultyFrame.getLblMaxLoadFall().setVisible(false);
            facultyFrame.getLblMaxLoadSpring().setVisible(false);
            facultyFrame.getLblMaxLoadSummer().setVisible(false);
            facultyFrame.getLblGradSchool().setVisible(false);

            facultyFrame.getFirstName().setVisible(true);
            facultyFrame.getLastName().setVisible(false);
            facultyFrame.getDegree().setVisible(false);
            facultyFrame.getTitleTextField().setVisible(false);
            facultyFrame.getDaysToTeach().setVisible(false);
            facultyFrame.getMaxLoadFall().setVisible(false);
            facultyFrame.getMaxLoadSpring().setVisible(false);
            facultyFrame.getMaxLoadSummer().setVisible(false);
            facultyFrame.getGradSchool().setVisible(false);

            facultyFrame.getAddFacultyButton().setVisible(false);
            facultyFrame.getUpdateFacultyButton().setVisible(false);
            facultyFrame.getDeleteFacultyButton().setVisible(true);
            //schoolFrame.getSchoolDataTable().setModel(DbUtils.resultSetToTableModel( new GradSchoolModel().getAllSchools()));
            facultyFrame.loadDataIntoJTable();
            mainPanel.add(facultyFrame);
            facultyFrame.setVisible(true);

        } catch (Exception exp) {
            JOptionPane.showMessageDialog(null, "Exception Raised " + exp);
        }
    }//GEN-LAST:event_facultyDeleteMenuItem1ActionPerformed

    private void FacultyMenuAncestorMoved(javax.swing.event.AncestorEvent evt) {//GEN-FIRST:event_FacultyMenuAncestorMoved
        // TODO add your handling code here:
    }//GEN-LAST:event_FacultyMenuAncestorMoved

    private void courseAddMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_courseAddMenuItem1ActionPerformed
        // TODO add your handling code here:
        try {
            mainPanel.removeAll();
            mainPanel.repaint();
            CourseJInternalFrame courseFrame = new CourseJInternalFrame();
            courseFrame.getCourseMsgLabel().setText("");

            courseFrame.getLblCourseCode().setVisible(true);
            courseFrame.getLblCourseName().setVisible(true);
            courseFrame.getLblCourseDesc().setVisible(true);
            courseFrame.getLblCourseHours().setVisible(true);
            courseFrame.getLblCourseCap().setVisible(true);
            courseFrame.getLblOfferedFall().setVisible(true);
            courseFrame.getLblOfferedSpring().setVisible(true);
            courseFrame.getLblOfferedSummer().setVisible(true);
            courseFrame.getLblCoursePreReqs().setVisible(true);
            courseFrame.getLblCourseTeachers().setVisible(true);

            courseFrame.getCourseCode().setVisible(true);
            courseFrame.getCourseName().setVisible(true);
            courseFrame.getCourseDesc().setVisible(true);
            courseFrame.getCourseHours().setVisible(true);
            courseFrame.getCourseCap().setVisible(true);
            courseFrame.getOfferedFall().setVisible(true);
            courseFrame.getOfferedSpring().setVisible(true);
            courseFrame.getOfferedSummer().setVisible(true);
            courseFrame.getCoursePreReqs().setVisible(true);
            courseFrame.getCourseTeachers().setVisible(true);

            courseFrame.getAddCourseButton().setVisible(true);
            courseFrame.getUpdateCourseButton().setVisible(false);
            courseFrame.getDeleteCourseButton().setVisible(false);
            //schoolFrame.getSchoolDataTable().setModel(DbUtils.resultSetToTableModel( new GradSchoolModel().getAllSchools()));
            courseFrame.loadDataIntoJTable();
            mainPanel.add(courseFrame);
            courseFrame.setVisible(true);

        } catch (Exception exp) {
            JOptionPane.showMessageDialog(null, "Exception Raised " + exp);
        }

    }//GEN-LAST:event_courseAddMenuItem1ActionPerformed

    private void courseUpdateMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_courseUpdateMenuItemActionPerformed
        // TODO add your handling code here:
        try {
            mainPanel.removeAll();
            mainPanel.repaint();
            CourseJInternalFrame courseFrame = new CourseJInternalFrame();
            courseFrame.getCourseMsgLabel().setText("");

            courseFrame.getLblCourseCode().setVisible(true);
            courseFrame.getLblCourseName().setVisible(true);
            courseFrame.getLblCourseDesc().setVisible(true);
            courseFrame.getLblCourseHours().setVisible(true);
            courseFrame.getLblCourseCap().setVisible(true);
            courseFrame.getLblOfferedFall().setVisible(true);
            courseFrame.getLblOfferedSpring().setVisible(true);
            courseFrame.getLblOfferedSummer().setVisible(true);
            courseFrame.getLblCoursePreReqs().setVisible(true);
            courseFrame.getLblCourseTeachers().setVisible(true);

            courseFrame.getCourseCode().setVisible(true);
            courseFrame.getCourseName().setVisible(true);
            courseFrame.getCourseDesc().setVisible(true);
            courseFrame.getCourseHours().setVisible(true);
            courseFrame.getCourseCap().setVisible(true);
            courseFrame.getOfferedFall().setVisible(true);
            courseFrame.getOfferedSpring().setVisible(true);
            courseFrame.getOfferedSummer().setVisible(true);
            courseFrame.getCoursePreReqs().setVisible(true);
            courseFrame.getCourseTeachers().setVisible(true);

            courseFrame.getAddCourseButton().setVisible(false);
            courseFrame.getUpdateCourseButton().setVisible(true);
            courseFrame.getDeleteCourseButton().setVisible(false);
            //schoolFrame.getSchoolDataTable().setModel(DbUtils.resultSetToTableModel( new GradSchoolModel().getAllSchools()));
            courseFrame.loadDataIntoJTable();
            mainPanel.add(courseFrame);
            courseFrame.setVisible(true);

        } catch (Exception exp) {
            JOptionPane.showMessageDialog(null, "Exception Raised " + exp);
        }
    }//GEN-LAST:event_courseUpdateMenuItemActionPerformed

    private void courseDeleteMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_courseDeleteMenuItemActionPerformed
        // TODO add your handling code here:
        try {
            mainPanel.removeAll();
            mainPanel.repaint();
            CourseJInternalFrame courseFrame = new CourseJInternalFrame();
            courseFrame.getCourseMsgLabel().setText("");

            courseFrame.getLblCourseCode().setVisible(true);
            courseFrame.getLblCourseName().setVisible(false);
            courseFrame.getLblCourseDesc().setVisible(false);
            courseFrame.getLblCourseHours().setVisible(false);
            courseFrame.getLblCourseCap().setVisible(false);
            courseFrame.getLblOfferedFall().setVisible(false);
            courseFrame.getLblOfferedSpring().setVisible(false);
            courseFrame.getLblOfferedSummer().setVisible(false);
            courseFrame.getLblCoursePreReqs().setVisible(false);
            courseFrame.getLblCourseTeachers().setVisible(false);

            courseFrame.getCourseCode().setVisible(true);
            courseFrame.getCourseName().setVisible(false);
            courseFrame.getCourseDesc().setVisible(false);
            courseFrame.getCourseHours().setVisible(false);
            courseFrame.getCourseCap().setVisible(false);
            courseFrame.getOfferedFall().setVisible(false);
            courseFrame.getOfferedSpring().setVisible(false);
            courseFrame.getOfferedSummer().setVisible(false);
            courseFrame.getCoursePreReqs().setVisible(false);
            courseFrame.getCourseTeachers().setVisible(false);

            courseFrame.getAddCourseButton().setVisible(false);
            courseFrame.getUpdateCourseButton().setVisible(false);
            courseFrame.getDeleteCourseButton().setVisible(true);
            //schoolFrame.getSchoolDataTable().setModel(DbUtils.resultSetToTableModel( new GradSchoolModel().getAllSchools()));
            courseFrame.loadDataIntoJTable();
            mainPanel.add(courseFrame);
            courseFrame.setVisible(true);

        } catch (Exception exp) {
            JOptionPane.showMessageDialog(null, "Exception Raised " + exp);
        }
    }//GEN-LAST:event_courseDeleteMenuItemActionPerformed

    private void CourseMenuAncestorMoved(javax.swing.event.AncestorEvent evt) {//GEN-FIRST:event_CourseMenuAncestorMoved
        // TODO add your handling code here:
    }//GEN-LAST:event_CourseMenuAncestorMoved

    private void degreePlanAddButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_degreePlanAddButtonActionPerformed
        // TODO add your handling code here:

        try {
            mainPanel.removeAll();
            mainPanel.repaint();
            DegreeJInternalFrame degreeFrame = new DegreeJInternalFrame();
            degreeFrame.getDegreeMsgLabel().setText("");

            degreeFrame.getLblDegreeCode().setVisible(true);
            degreeFrame.getLblDeptTrack().setVisible(true);
            degreeFrame.getLblDescription().setVisible(true);
            degreeFrame.getLblType().setVisible(true);
            degreeFrame.getLblCoursesList().setVisible(true);
            degreeFrame.getLblHoursReq().setVisible(true);
            degreeFrame.getLblGrandSchool().setVisible(true);
            degreeFrame.getLblForecast().setVisible(true);

            degreeFrame.getDegreeCode().setVisible(true);
            degreeFrame.getDeptTrack().setVisible(true);
            degreeFrame.getDescription().setVisible(true);
            degreeFrame.getType().setVisible(true);
            degreeFrame.getCoursesList().setVisible(true);
            degreeFrame.getHoursReq().setVisible(true);
            degreeFrame.getGrandSchool().setVisible(true);
            degreeFrame.getForecast().setVisible(true);
            degreeFrame.getjScrollPane2().setVisible(true);

            degreeFrame.getAddDegreeButton().setVisible(true);
            degreeFrame.getUpdateDegreeButton().setVisible(false);
            degreeFrame.getDeleteDegreeButton().setVisible(false);
            //schoolFrame.getSchoolDataTable().setModel(DbUtils.resultSetToTableModel( new GradSchoolModel().getAllSchools()));
            degreeFrame.loadDataIntoJTable();
            mainPanel.add(degreeFrame);
            degreeFrame.setVisible(true);

        } catch (Exception exp) {
            JOptionPane.showMessageDialog(null, "Exception Raised " + exp);
        }
    }//GEN-LAST:event_degreePlanAddButtonActionPerformed

    private void degreePlanUpdateButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_degreePlanUpdateButtonActionPerformed
        // TODO add your handling code here:
        try {
            mainPanel.removeAll();
            mainPanel.repaint();
            DegreeJInternalFrame degreeFrame = new DegreeJInternalFrame();
            degreeFrame.getDegreeMsgLabel().setText("");

            degreeFrame.getLblDegreeCode().setVisible(true);
            degreeFrame.getLblDeptTrack().setVisible(true);
            degreeFrame.getLblDescription().setVisible(true);
            degreeFrame.getLblType().setVisible(true);
            degreeFrame.getLblCoursesList().setVisible(true);
            degreeFrame.getLblHoursReq().setVisible(true);
            degreeFrame.getLblGrandSchool().setVisible(true);
            degreeFrame.getLblForecast().setVisible(true);

            degreeFrame.getDegreeCode().setVisible(true);
            degreeFrame.getDeptTrack().setVisible(true);
            degreeFrame.getDescription().setVisible(true);
            degreeFrame.getType().setVisible(true);
            degreeFrame.getCoursesList().setVisible(true);
            degreeFrame.getHoursReq().setVisible(true);
            degreeFrame.getGrandSchool().setVisible(true);
            degreeFrame.getForecast().setVisible(true);
            degreeFrame.getjScrollPane2().setVisible(true);

            degreeFrame.getAddDegreeButton().setVisible(false);
            degreeFrame.getUpdateDegreeButton().setVisible(true);
            degreeFrame.getDeleteDegreeButton().setVisible(false);
            //schoolFrame.getSchoolDataTable().setModel(DbUtils.resultSetToTableModel( new GradSchoolModel().getAllSchools()));
            degreeFrame.loadDataIntoJTable();
            mainPanel.add(degreeFrame);
            degreeFrame.setVisible(true);

        } catch (Exception exp) {
            JOptionPane.showMessageDialog(null, "Exception Raised " + exp);
        }
    }//GEN-LAST:event_degreePlanUpdateButtonActionPerformed

    private void degreePlanDeleteButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_degreePlanDeleteButtonActionPerformed
        // TODO add your handling code here:
        try {
            mainPanel.removeAll();
            mainPanel.repaint();
            DegreeJInternalFrame degreeFrame = new DegreeJInternalFrame();
            degreeFrame.getDegreeMsgLabel().setText("");

            degreeFrame.getLblDegreeCode().setVisible(true);
            degreeFrame.getLblDeptTrack().setVisible(false);
            degreeFrame.getLblDescription().setVisible(false);
            degreeFrame.getLblType().setVisible(false);
            degreeFrame.getLblCoursesList().setVisible(false);
            degreeFrame.getLblHoursReq().setVisible(false);
            degreeFrame.getLblGrandSchool().setVisible(false);
            degreeFrame.getLblForecast().setVisible(false);

            degreeFrame.getDegreeCode().setVisible(true);
            degreeFrame.getDeptTrack().setVisible(false);
            degreeFrame.getDescription().setVisible(false);
            degreeFrame.getType().setVisible(false);
            degreeFrame.getCoursesList().setVisible(false);
            degreeFrame.getHoursReq().setVisible(false);
            degreeFrame.getGrandSchool().setVisible(false);
            degreeFrame.getForecast().setVisible(false);
            degreeFrame.getjScrollPane2().setVisible(false);

            degreeFrame.getAddDegreeButton().setVisible(false);
            degreeFrame.getUpdateDegreeButton().setVisible(false);
            degreeFrame.getDeleteDegreeButton().setVisible(true);
            //schoolFrame.getSchoolDataTable().setModel(DbUtils.resultSetToTableModel( new GradSchoolModel().getAllSchools()));
            degreeFrame.loadDataIntoJTable();
            mainPanel.add(degreeFrame);
            degreeFrame.setVisible(true);

        } catch (Exception exp) {
            JOptionPane.showMessageDialog(null, "Exception Raised " + exp);
        }
    }//GEN-LAST:event_degreePlanDeleteButtonActionPerformed

    private void degreePlanMenuAncestorMoved(javax.swing.event.AncestorEvent evt) {//GEN-FIRST:event_degreePlanMenuAncestorMoved
        // TODO add your handling code here:
    }//GEN-LAST:event_degreePlanMenuAncestorMoved

    private void importSchoolDataActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_importSchoolDataActionPerformed
        // TODO add your handling code here:
        JFileChooser jf = new JFileChooser();
        jf.setDialogTitle("Please select a excel File to import");
        int result = jf.showOpenDialog(null);
        if (result == JFileChooser.APPROVE_OPTION) {
            String filePath = jf.getSelectedFile().getAbsolutePath();

            try {
                FileInputStream fis = new FileInputStream(filePath);
                Workbook workbook = new XSSFWorkbook(fis);
                Sheet firstSheet = workbook.getSheetAt(0);
                Iterator<Row> iterator = firstSheet.iterator();
                List<SchoolBean> schoolBeanList = new ArrayList<SchoolBean>();

                while (iterator.hasNext()) {
                    Row nextRow = iterator.next();
                    if (nextRow.getRowNum() != 0) {
                        Iterator<Cell> cellIterator = nextRow.cellIterator();
                        SchoolBean school = new SchoolBean();

                        while (cellIterator.hasNext()) {
                            Cell nextCell = cellIterator.next();
                            int columnIndex = nextCell.getColumnIndex();

                            switch (columnIndex) {
                            case 0:
                                school.setSchoolAbbrv((String) getCellValue(nextCell));
                                break;
                            case 1:
                                school.setSchoolName((String) getCellValue(nextCell));
                                break;

                            }

                        }
                        schoolBeanList.add(school);
                    }

                }
                workbook.close();
                fis.close();

                mainPanel.removeAll();
                mainPanel.repaint();
                GradSchoolModel model = new GradSchoolModel();
                GradSchoolJInternalFrame schoolFrame = new GradSchoolJInternalFrame();
                schoolFrame.getSchoolMsgLabel().setText("");
                schoolFrame.getAddSchoolButton().setVisible(true);
                schoolFrame.getUpdateSchoolButton().setVisible(false);
                schoolFrame.getDeleteSchoolButton().setVisible(false);
                //schoolFrame.getSchoolDataTable().setModel(DbUtils.resultSetToTableModel( new GradSchoolModel().getAllSchools()));
                for (SchoolBean schoolBean : schoolBeanList) {
                    try {
                        model.addSchool(schoolBean);
                    } catch (Exception exp) {
                        System.out.println("Exception Raised....." + exp.getMessage());
                    }
                }
                schoolFrame.loadDataIntoJTable();
                mainPanel.add(schoolFrame);
                schoolFrame.setVisible(true);
            } catch (Exception exp) {
                JOptionPane.showMessageDialog(null, exp.getMessage());
            }

        }

    }//GEN-LAST:event_importSchoolDataActionPerformed

    private void facultyImportMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_facultyImportMenuItemActionPerformed
        // TODO add your handling code here:
        JFileChooser jf = new JFileChooser();
        jf.setDialogTitle("Please select a excel File to import");
        int result = jf.showOpenDialog(null);
        if (result == JFileChooser.APPROVE_OPTION) {
            String filePath = jf.getSelectedFile().getAbsolutePath();

            try {
                FileInputStream fis = new FileInputStream(filePath);
                Workbook workbook = new XSSFWorkbook(fis);
                Sheet firstSheet = workbook.getSheetAt(0);
                Iterator<Row> iterator = firstSheet.iterator();
                List<FacultyBean> facultyBeanList = new ArrayList<FacultyBean>();

                while (iterator.hasNext()) {
                    Row nextRow = iterator.next();
                    if (nextRow.getRowNum() != 0) {
                        Iterator<Cell> cellIterator = nextRow.cellIterator();
                        FacultyBean faculty = new FacultyBean();

                        while (cellIterator.hasNext()) {
                            Cell nextCell = cellIterator.next();
                            int columnIndex = nextCell.getColumnIndex();

                            switch (columnIndex) {
                            case 0:
                                faculty.setLastName((String) getCellValue(nextCell));
                                break;
                            case 1:
                                faculty.setFirstName((String) getCellValue(nextCell));
                                break;
                            case 2:
                                faculty.setGradSchool((String) getCellValue(nextCell));
                                break;
                            case 3:
                                faculty.setDegree((String) getCellValue(nextCell));
                                break;
                            case 4:
                                faculty.setTitle((String) getCellValue(nextCell));
                                break;
                            case 5:
                                faculty.setDaysToTeach(getCellValue(nextCell).toString());
                                break;
                            case 6:
                                faculty.setMaxLoadFall(Double.valueOf(getCellValue(nextCell).toString()));
                                break;
                            case 7:
                                faculty.setMaxLoadSpring(Double.valueOf(getCellValue(nextCell).toString()));
                                break;
                            case 8:
                                faculty.setMaxLoadSummer(Double.valueOf(getCellValue(nextCell).toString()));
                                break;
                            }

                        }
                        facultyBeanList.add(faculty);
                    }

                }
                workbook.close();
                fis.close();

                mainPanel.removeAll();
                mainPanel.repaint();
                FacultyModel model = new FacultyModel();
                FacultyJInternalFrame facultyFrame = new FacultyJInternalFrame();
                facultyFrame.getFacultyMsgLabel().setText("");
                facultyFrame.getAddFacultyButton().setVisible(true);
                facultyFrame.getUpdateFacultyButton().setVisible(false);
                facultyFrame.getDeleteFacultyButton().setVisible(false);
                //schoolFrame.getSchoolDataTable().setModel(DbUtils.resultSetToTableModel( new GradSchoolModel().getAllSchools()));
                for (FacultyBean facultyBean : facultyBeanList) {
                    try {
                        model.addFaculty(facultyBean);
                    } catch (Exception exp) {
                        System.out.println("Exception Raised....." + exp.getMessage());
                    }
                }
                facultyFrame.loadDataIntoJTable();
                mainPanel.add(facultyFrame);
                facultyFrame.setVisible(true);
            } catch (Exception exp) {
                JOptionPane.showMessageDialog(null, exp.getMessage());
            }

        }
    }//GEN-LAST:event_facultyImportMenuItemActionPerformed

    private void importCourseMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_importCourseMenuItemActionPerformed
        // TODO add your handling code here:
        JFileChooser jf = new JFileChooser();
        jf.setDialogTitle("Please select a excel File to import");
        int result = jf.showOpenDialog(null);
        if (result == JFileChooser.APPROVE_OPTION) {
            String filePath = jf.getSelectedFile().getAbsolutePath();

            try {
                FileInputStream fis = new FileInputStream(filePath);
                Workbook workbook = new XSSFWorkbook(fis);
                Sheet firstSheet = workbook.getSheetAt(0);
                Iterator<Row> iterator = firstSheet.iterator();
                List<CourseBean> courseBeanList = new ArrayList<CourseBean>();

                while (iterator.hasNext()) {
                    Row nextRow = iterator.next();
                    if (nextRow.getRowNum() != 0) {
                        Iterator<Cell> cellIterator = nextRow.cellIterator();
                        CourseBean courseBean = new CourseBean();

                        while (cellIterator.hasNext()) {
                            Cell nextCell = cellIterator.next();
                            int columnIndex = nextCell.getColumnIndex();

                            switch (columnIndex) {
                            case 0:
                                courseBean.setCourseCode((String) getCellValue(nextCell));
                                break;
                            case 1:
                                courseBean.setCourseName((String) getCellValue(nextCell));
                                break;
                            case 2:
                                courseBean.setCourseDesc((String) getCellValue(nextCell));
                                break;
                            case 3:
                                courseBean.setCourseHours(Double.valueOf(getCellValue(nextCell).toString()));
                                break;
                            case 4:
                                courseBean.setCourseCap(Double.valueOf(getCellValue(nextCell).toString()));
                                break;
                            case 5:
                                courseBean.setOfferedFall((String) getCellValue(nextCell));
                                break;
                            case 6:
                                courseBean.setOfferedSpring((String) getCellValue(nextCell));
                                break;
                            case 7:
                                courseBean.setOfferedSummer((String) getCellValue(nextCell));
                                break;
                            case 8:
                                courseBean.setCoursePreReq((String) getCellValue(nextCell));
                                break;
                            case 9:
                                courseBean.setTeacher((String) getCellValue(nextCell));
                                break;
                            }

                        }
                        courseBeanList.add(courseBean);
                    }

                }
                workbook.close();
                fis.close();

                mainPanel.removeAll();
                mainPanel.repaint();
                CourseModel model = new CourseModel();
                CourseJInternalFrame courseFrame = new CourseJInternalFrame();
                courseFrame.getCourseMsgLabel().setText("");
                courseFrame.getAddCourseButton().setVisible(true);
                courseFrame.getUpdateCourseButton().setVisible(false);
                courseFrame.getDeleteCourseButton().setVisible(false);
                //schoolFrame.getSchoolDataTable().setModel(DbUtils.resultSetToTableModel( new GradSchoolModel().getAllSchools()));
                for (CourseBean courseBean : courseBeanList) {
                    try {
                        model.addCourse(courseBean);
                    } catch (Exception exp) {
                        System.out.println("Exception Raised....." + exp.getMessage());
                    }
                }
                courseFrame.loadDataIntoJTable();
                mainPanel.add(courseFrame);
                courseFrame.setVisible(true);
            } catch (Exception exp) {
                JOptionPane.showMessageDialog(null, exp.getMessage());
            }

        }
    }//GEN-LAST:event_importCourseMenuItemActionPerformed

    private void importDegreePlanMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_importDegreePlanMenuItemActionPerformed
        // TODO add your handling code here:
        JFileChooser jf = new JFileChooser();
        jf.setDialogTitle("Please select a excel File to import");
        int result = jf.showOpenDialog(null);
        if (result == JFileChooser.APPROVE_OPTION) {
            String filePath = jf.getSelectedFile().getAbsolutePath();

            try {
                FileInputStream fis = new FileInputStream(filePath);
                Workbook workbook = new XSSFWorkbook(fis);
                Sheet firstSheet = workbook.getSheetAt(0);
                Iterator<Row> iterator = firstSheet.iterator();
                List<DegreePlanBean> degreePlanBeanList = new ArrayList<DegreePlanBean>();

                while (iterator.hasNext()) {
                    Row nextRow = iterator.next();
                    if (nextRow.getRowNum() != 0) {
                        Iterator<Cell> cellIterator = nextRow.cellIterator();
                        DegreePlanBean degreePlan = new DegreePlanBean();

                        while (cellIterator.hasNext()) {
                            Cell nextCell = cellIterator.next();
                            int columnIndex = nextCell.getColumnIndex();

                            switch (columnIndex) {
                            case 0:
                                degreePlan.setDegreeCode((String) getCellValue(nextCell));
                                break;
                            case 1:
                                degreePlan.setDeptTrack((String) getCellValue(nextCell));
                                break;
                            case 2:
                                degreePlan.setDescription((String) getCellValue(nextCell));
                                break;
                            case 3:
                                degreePlan.setHoursReq(Double.valueOf(getCellValue(nextCell).toString()));
                                break;
                            case 4:
                                degreePlan.setType((String) getCellValue(nextCell));
                                break;
                            case 5:
                                degreePlan.setCourses((String) getCellValue(nextCell));
                                break;
                            case 6:
                                degreePlan.setGradSchool((String) getCellValue(nextCell));
                                break;
                            case 7:
                                degreePlan.setForecast(Double.valueOf(getCellValue(nextCell).toString()));
                                break;

                            }

                        }
                        degreePlanBeanList.add(degreePlan);
                    }

                }
                workbook.close();
                fis.close();

                mainPanel.removeAll();
                mainPanel.repaint();
                DegreePlanModel model = new DegreePlanModel();
                DegreeJInternalFrame degreeFrame = new DegreeJInternalFrame();
                degreeFrame.getDegreeMsgLabel().setText("");
                degreeFrame.getAddDegreeButton().setVisible(true);
                degreeFrame.getUpdateDegreeButton().setVisible(false);
                degreeFrame.getDeleteDegreeButton().setVisible(false);
                //schoolFrame.getSchoolDataTable().setModel(DbUtils.resultSetToTableModel( new GradSchoolModel().getAllSchools()));
                for (DegreePlanBean degreePlanBean : degreePlanBeanList) {
                    try {
                        model.addDegree(degreePlanBean);
                    } catch (Exception exp) {
                        System.out.println("Exception Raised....." + exp.getMessage());
                    }
                }
                degreeFrame.loadDataIntoJTable();
                mainPanel.add(degreeFrame);
                degreeFrame.setVisible(true);
            } catch (Exception exp) {
                JOptionPane.showMessageDialog(null, exp.getMessage());
            }

        }
    }//GEN-LAST:event_importDegreePlanMenuItemActionPerformed

    private void studentAddMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_studentAddMenuItemActionPerformed
        // TODO add your handling code here:
        // TODO add your handling code here:

        try {
            mainPanel.removeAll();
            mainPanel.repaint();
            StudentJInternalFrame studentFrame = new StudentJInternalFrame();
            studentFrame.getStudentMsgLabel().setText("");

            studentFrame.getLblStudentId().setVisible(true);
            studentFrame.getLblDegreeCode().setVisible(true);
            studentFrame.getLblGraduationTerm().setVisible(true);

            studentFrame.getStudentId().setVisible(true);
            studentFrame.getDegreeCode().setVisible(true);
            studentFrame.getGraduationTerm().setVisible(true);

            studentFrame.getAddStudentButton().setVisible(true);
            studentFrame.getUpdateStudentButton().setVisible(false);
            studentFrame.getDeleteStudentButton().setVisible(false);
            //schoolFrame.getSchoolDataTable().setModel(DbUtils.resultSetToTableModel( new GradSchoolModel().getAllSchools()));
            studentFrame.loadDataIntoJTable();
            mainPanel.add(studentFrame);
            studentFrame.setVisible(true);

        } catch (Exception exp) {
            JOptionPane.showMessageDialog(null, "Exception Raised " + exp);
        }

    }//GEN-LAST:event_studentAddMenuItemActionPerformed

    private void studentUpdateMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_studentUpdateMenuItemActionPerformed
        // TODO add your handling code here:
        // TODO add your handling code here:

        try {
            mainPanel.removeAll();
            mainPanel.repaint();
            StudentJInternalFrame studentFrame = new StudentJInternalFrame();
            studentFrame.getStudentMsgLabel().setText("");

            studentFrame.getLblStudentId().setVisible(true);
            studentFrame.getLblDegreeCode().setVisible(true);
            studentFrame.getLblGraduationTerm().setVisible(true);

            studentFrame.getStudentId().setVisible(true);
            studentFrame.getDegreeCode().setVisible(true);
            studentFrame.getGraduationTerm().setVisible(true);

            studentFrame.getAddStudentButton().setVisible(false);
            studentFrame.getUpdateStudentButton().setVisible(true);
            studentFrame.getDeleteStudentButton().setVisible(false);
            //schoolFrame.getSchoolDataTable().setModel(DbUtils.resultSetToTableModel( new GradSchoolModel().getAllSchools()));
            studentFrame.loadDataIntoJTable();
            mainPanel.add(studentFrame);
            studentFrame.setVisible(true);

        } catch (Exception exp) {
            JOptionPane.showMessageDialog(null, "Exception Raised " + exp);
        }
    }//GEN-LAST:event_studentUpdateMenuItemActionPerformed

    private void studentDeleteMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_studentDeleteMenuItemActionPerformed
        // TODO add your handling code here:
        // TODO add your handling code here:

        try {
            mainPanel.removeAll();
            mainPanel.repaint();
            StudentJInternalFrame studentFrame = new StudentJInternalFrame();
            studentFrame.getStudentMsgLabel().setText("");

            studentFrame.getLblStudentId().setVisible(true);
            studentFrame.getLblDegreeCode().setVisible(false);
            studentFrame.getLblGraduationTerm().setVisible(false);

            studentFrame.getStudentId().setVisible(true);
            studentFrame.getDegreeCode().setVisible(false);
            studentFrame.getGraduationTerm().setVisible(false);

            studentFrame.getAddStudentButton().setVisible(false);
            studentFrame.getUpdateStudentButton().setVisible(false);
            studentFrame.getDeleteStudentButton().setVisible(true);
            //schoolFrame.getSchoolDataTable().setModel(DbUtils.resultSetToTableModel( new GradSchoolModel().getAllSchools()));
            studentFrame.loadDataIntoJTable();
            mainPanel.add(studentFrame);
            studentFrame.setVisible(true);

        } catch (Exception exp) {
            JOptionPane.showMessageDialog(null, "Exception Raised " + exp);
        }
    }//GEN-LAST:event_studentDeleteMenuItemActionPerformed

    private void importStudentMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_importStudentMenuItemActionPerformed
        // TODO add your handling code here:
        JFileChooser jf = new JFileChooser();
        jf.setDialogTitle("Please select a excel File to import");
        int result = jf.showOpenDialog(null);
        if (result == JFileChooser.APPROVE_OPTION) {
            String filePath = jf.getSelectedFile().getAbsolutePath();

            try {
                FileInputStream fis = new FileInputStream(filePath);
                Workbook workbook = new XSSFWorkbook(fis);
                Sheet firstSheet = workbook.getSheetAt(0);
                Iterator<Row> iterator = firstSheet.iterator();
                List<StudentBean> studentBeansList = new ArrayList<StudentBean>();

                while (iterator.hasNext()) {
                    Row nextRow = iterator.next();
                    if (nextRow.getRowNum() != 0) {
                        Iterator<Cell> cellIterator = nextRow.cellIterator();
                        StudentBean studentBean = new StudentBean();

                        while (cellIterator.hasNext()) {
                            Cell nextCell = cellIterator.next();
                            int columnIndex = nextCell.getColumnIndex();

                            switch (columnIndex) {
                            case 0:
                                studentBean.setStudentId(getCellValue(nextCell).toString().replace(".0", ""));
                                break;
                            case 1:
                                studentBean.setDegreeCode((String) getCellValue(nextCell));
                                break;
                            case 2:
                                studentBean.setGraduationDate((String) getCellValue(nextCell));
                                break;

                            }

                        }
                        studentBeansList.add(studentBean);
                    }

                }
                workbook.close();
                fis.close();

                mainPanel.removeAll();
                mainPanel.repaint();
                StudentModel model = new StudentModel();
                StudentJInternalFrame studentFrame = new StudentJInternalFrame();
                studentFrame.getStudentMsgLabel().setText("");
                studentFrame.getAddStudentButton().setVisible(true);
                studentFrame.getUpdateStudentButton().setVisible(false);
                studentFrame.getDeleteStudentButton().setVisible(false);
                //schoolFrame.getSchoolDataTable().setModel(DbUtils.resultSetToTableModel( new GradSchoolModel().getAllSchools()));
                for (StudentBean studentBean : studentBeansList) {
                    try {
                        model.addStudent(studentBean);
                    } catch (Exception exp) {
                        System.out.println("Exception Raised....." + exp.getMessage());
                    }
                }
                studentFrame.loadDataIntoJTable();
                mainPanel.add(studentFrame);
                studentFrame.setVisible(true);
            } catch (Exception exp) {
                JOptionPane.showMessageDialog(null, exp.getMessage());
            }

        }
    }//GEN-LAST:event_importStudentMenuItemActionPerformed

    private void studentMenuAncestorMoved(javax.swing.event.AncestorEvent evt) {//GEN-FIRST:event_studentMenuAncestorMoved
        // TODO add your handling code here:
    }//GEN-LAST:event_studentMenuAncestorMoved

    private void studentCourseAddMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_studentCourseAddMenuItemActionPerformed
        // TODO add your handling code here:

        try {
            mainPanel.removeAll();
            mainPanel.repaint();
            StudentCourseJInternalFrame studentFrame = new StudentCourseJInternalFrame();
            studentFrame.getStudentMsgLabel().setText("");

            studentFrame.getLblStudentId().setVisible(true);
            studentFrame.getLblStudentCourseId().setVisible(true);
            studentFrame.getLblStudentCourseDesc().setVisible(true);
            studentFrame.getLblStudentCourseTerm().setVisible(true);
            studentFrame.getLblStudentCourseGrade().setVisible(true);

            studentFrame.getStudentId().setVisible(true);
            studentFrame.getCourseId().setVisible(true);
            studentFrame.getCourseDesc().setVisible(true);
            studentFrame.getTerm().setVisible(true);
            studentFrame.getGrade().setVisible(true);

            studentFrame.getAddStudentCourseButton().setVisible(true);
            studentFrame.getUpdateStudentCourseButton().setVisible(false);
            studentFrame.getDeleteStudentCourseButton().setVisible(false);
            //schoolFrame.getSchoolDataTable().setModel(DbUtils.resultSetToTableModel( new GradSchoolModel().getAllSchools()));
            studentFrame.loadDataIntoJTable();
            mainPanel.add(studentFrame);
            studentFrame.setVisible(true);

        } catch (Exception exp) {
            JOptionPane.showMessageDialog(null, "Exception Raised " + exp);
        }

    }//GEN-LAST:event_studentCourseAddMenuItemActionPerformed

    private void studentCourseUpdateMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_studentCourseUpdateMenuItemActionPerformed
        // TODO add your handling code here:

        try {
            mainPanel.removeAll();
            mainPanel.repaint();
            StudentCourseJInternalFrame studentFrame = new StudentCourseJInternalFrame();
            studentFrame.getStudentMsgLabel().setText("");

            studentFrame.getLblStudentId().setVisible(true);
            studentFrame.getLblStudentCourseId().setVisible(true);
            studentFrame.getLblStudentCourseDesc().setVisible(true);
            studentFrame.getLblStudentCourseTerm().setVisible(true);
            studentFrame.getLblStudentCourseGrade().setVisible(true);

            studentFrame.getStudentId().setVisible(true);
            studentFrame.getCourseId().setVisible(true);
            studentFrame.getCourseDesc().setVisible(true);
            studentFrame.getTerm().setVisible(true);
            studentFrame.getGrade().setVisible(true);

            studentFrame.getAddStudentCourseButton().setVisible(false);
            studentFrame.getUpdateStudentCourseButton().setVisible(true);
            studentFrame.getDeleteStudentCourseButton().setVisible(false);
            //schoolFrame.getSchoolDataTable().setModel(DbUtils.resultSetToTableModel( new GradSchoolModel().getAllSchools()));
            studentFrame.loadDataIntoJTable();
            mainPanel.add(studentFrame);
            studentFrame.setVisible(true);

        } catch (Exception exp) {
            JOptionPane.showMessageDialog(null, "Exception Raised " + exp);
        }
    }//GEN-LAST:event_studentCourseUpdateMenuItemActionPerformed

    private void studentCourseDeleteMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_studentCourseDeleteMenuItemActionPerformed
        // TODO add your handling code here:
        try {
            mainPanel.removeAll();
            mainPanel.repaint();
            StudentCourseJInternalFrame studentFrame = new StudentCourseJInternalFrame();
            studentFrame.getStudentMsgLabel().setText("");

            studentFrame.getLblStudentId().setVisible(true);
            studentFrame.getLblStudentCourseId().setVisible(false);
            studentFrame.getLblStudentCourseDesc().setVisible(false);
            studentFrame.getLblStudentCourseTerm().setVisible(false);
            studentFrame.getLblStudentCourseGrade().setVisible(false);

            studentFrame.getStudentId().setVisible(true);
            studentFrame.getCourseId().setVisible(false);
            studentFrame.getCourseDesc().setVisible(false);
            studentFrame.getTerm().setVisible(false);
            studentFrame.getGrade().setVisible(false);

            studentFrame.getAddStudentCourseButton().setVisible(false);
            studentFrame.getUpdateStudentCourseButton().setVisible(false);
            studentFrame.getDeleteStudentCourseButton().setVisible(true);
            //schoolFrame.getSchoolDataTable().setModel(DbUtils.resultSetToTableModel( new GradSchoolModel().getAllSchools()));
            studentFrame.loadDataIntoJTable();
            mainPanel.add(studentFrame);
            studentFrame.setVisible(true);

        } catch (Exception exp) {
            JOptionPane.showMessageDialog(null, "Exception Raised " + exp);
        }
    }//GEN-LAST:event_studentCourseDeleteMenuItemActionPerformed

    private void importStudentCourseMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_importStudentCourseMenuItemActionPerformed
        // TODO add your handling code here:
        JFileChooser jf = new JFileChooser();
        jf.setDialogTitle("Please select a excel File to import");
        int result = jf.showOpenDialog(null);
        if (result == JFileChooser.APPROVE_OPTION) {
            String filePath = jf.getSelectedFile().getAbsolutePath();

            try {
                FileInputStream fis = new FileInputStream(filePath);
                Workbook workbook = new XSSFWorkbook(fis);
                Sheet firstSheet = workbook.getSheetAt(0);
                Iterator<Row> iterator = firstSheet.iterator();
                List<StudentCourseBean> studentCourseBeansList = new ArrayList<StudentCourseBean>();

                while (iterator.hasNext()) {
                    Row nextRow = iterator.next();
                    if (nextRow.getRowNum() != 0) {
                        Iterator<Cell> cellIterator = nextRow.cellIterator();
                        StudentCourseBean studentBean = new StudentCourseBean();

                        while (cellIterator.hasNext()) {
                            Cell nextCell = cellIterator.next();
                            int columnIndex = nextCell.getColumnIndex();

                            switch (columnIndex) {
                            case 0:
                                studentBean.setStudentId(getCellValue(nextCell).toString().replace(".0", ""));
                                break;
                            case 1:
                                studentBean.setCourseId((String) getCellValue(nextCell));
                                break;
                            case 2:
                                studentBean.setCourseDesc((String) getCellValue(nextCell));
                                break;
                            case 3:
                                studentBean.setTerm((String) getCellValue(nextCell));
                                break;
                            case 4:
                                studentBean.setGrade((String) getCellValue(nextCell));
                                break;

                            }

                        }
                        studentCourseBeansList.add(studentBean);
                    }

                }
                workbook.close();
                fis.close();

                mainPanel.removeAll();
                mainPanel.repaint();
                StudentModel model = new StudentModel();
                StudentCourseJInternalFrame studentFrame = new StudentCourseJInternalFrame();
                studentFrame.getStudentMsgLabel().setText("");
                studentFrame.getAddStudentCourseButton().setVisible(true);
                studentFrame.getUpdateStudentCourseButton().setVisible(false);
                studentFrame.getDeleteStudentCourseButton().setVisible(false);
                //schoolFrame.getSchoolDataTable().setModel(DbUtils.resultSetToTableModel( new GradSchoolModel().getAllSchools()));
                for (StudentCourseBean studentBean : studentCourseBeansList) {
                    try {
                        model.addStudentCourse(studentBean);
                    } catch (Exception exp) {
                        System.out.println("Exception Raised....." + exp.getMessage());
                    }
                }
                studentFrame.loadDataIntoJTable();
                mainPanel.add(studentFrame);
                studentFrame.setVisible(true);
            } catch (Exception exp) {
                JOptionPane.showMessageDialog(null, exp.getMessage());
            }

        }
    }//GEN-LAST:event_importStudentCourseMenuItemActionPerformed

    private void studentCourseMenuAncestorMoved(javax.swing.event.AncestorEvent evt) {//GEN-FIRST:event_studentCourseMenuAncestorMoved
        // TODO add your handling code here:
    }//GEN-LAST:event_studentCourseMenuAncestorMoved

    private void courseSectionAddMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_courseSectionAddMenuItemActionPerformed
        // TODO add your handling code here:
        try {
            mainPanel.removeAll();
            mainPanel.repaint();
            CourseSectionJInternalFrame courseSectionFrame = new CourseSectionJInternalFrame();
            courseSectionFrame.getCourseSectionMsgLabel().setText("");

            courseSectionFrame.getLblSectionNumber().setVisible(true);
            courseSectionFrame.getLblCourse().setVisible(true);
            courseSectionFrame.getLblFaculty().setVisible(true);

            courseSectionFrame.getSectionNumber().setVisible(true);
            courseSectionFrame.getCourse().setVisible(true);
            courseSectionFrame.getFaculty().setVisible(true);

            courseSectionFrame.getAddCourseSectionButton().setVisible(true);
            courseSectionFrame.getUpdateCourseSectionButton().setVisible(false);
            courseSectionFrame.getDeleteCourseSectionButton().setVisible(false);
            //schoolFrame.getSchoolDataTable().setModel(DbUtils.resultSetToTableModel( new GradSchoolModel().getAllSchools()));
            courseSectionFrame.loadDataIntoJTable();
            mainPanel.add(courseSectionFrame);
            courseSectionFrame.setVisible(true);

        } catch (Exception exp) {
            JOptionPane.showMessageDialog(null, "Exception Raised " + exp);
        }

    }//GEN-LAST:event_courseSectionAddMenuItemActionPerformed

    private void courseSectionUpdateMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_courseSectionUpdateMenuItemActionPerformed
        // TODO add your handling code here:
        // TODO add your handling code here:
        try {
            mainPanel.removeAll();
            mainPanel.repaint();
            CourseSectionJInternalFrame courseSectionFrame = new CourseSectionJInternalFrame();
            courseSectionFrame.getCourseSectionMsgLabel().setText("");

            courseSectionFrame.getLblSectionNumber().setVisible(true);
            courseSectionFrame.getLblCourse().setVisible(true);
            courseSectionFrame.getLblFaculty().setVisible(true);

            courseSectionFrame.getSectionNumber().setVisible(true);
            courseSectionFrame.getCourse().setVisible(true);
            courseSectionFrame.getFaculty().setVisible(true);

            courseSectionFrame.getAddCourseSectionButton().setVisible(false);
            courseSectionFrame.getUpdateCourseSectionButton().setVisible(true);
            courseSectionFrame.getDeleteCourseSectionButton().setVisible(false);
            //schoolFrame.getSchoolDataTable().setModel(DbUtils.resultSetToTableModel( new GradSchoolModel().getAllSchools()));
            courseSectionFrame.loadDataIntoJTable();
            mainPanel.add(courseSectionFrame);
            courseSectionFrame.setVisible(true);

        } catch (Exception exp) {
            JOptionPane.showMessageDialog(null, "Exception Raised " + exp);
        }
    }//GEN-LAST:event_courseSectionUpdateMenuItemActionPerformed

    private void courseSectionDeleteMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_courseSectionDeleteMenuItemActionPerformed
        // TODO add your handling code here:
        // TODO add your handling code here:
        try {
            mainPanel.removeAll();
            mainPanel.repaint();
            CourseSectionJInternalFrame courseSectionFrame = new CourseSectionJInternalFrame();
            courseSectionFrame.getCourseSectionMsgLabel().setText("");

            courseSectionFrame.getLblSectionNumber().setVisible(true);
            courseSectionFrame.getLblCourse().setVisible(false);
            courseSectionFrame.getLblFaculty().setVisible(false);

            courseSectionFrame.getSectionNumber().setVisible(true);
            courseSectionFrame.getCourse().setVisible(false);
            courseSectionFrame.getFaculty().setVisible(false);

            courseSectionFrame.getAddCourseSectionButton().setVisible(false);
            courseSectionFrame.getUpdateCourseSectionButton().setVisible(false);
            courseSectionFrame.getDeleteCourseSectionButton().setVisible(true);
            //schoolFrame.getSchoolDataTable().setModel(DbUtils.resultSetToTableModel( new GradSchoolModel().getAllSchools()));
            courseSectionFrame.loadDataIntoJTable();
            mainPanel.add(courseSectionFrame);
            courseSectionFrame.setVisible(true);

        } catch (Exception exp) {
            JOptionPane.showMessageDialog(null, "Exception Raised " + exp);
        }
    }//GEN-LAST:event_courseSectionDeleteMenuItemActionPerformed

    private void importcourseSectionMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_importcourseSectionMenuItemActionPerformed
        // TODO add your handling code here:
        JFileChooser jf = new JFileChooser();
        jf.setDialogTitle("Please select a excel File to import");
        int result = jf.showOpenDialog(null);
        if (result == JFileChooser.APPROVE_OPTION) {
            String filePath = jf.getSelectedFile().getAbsolutePath();

            try {
                FileInputStream fis = new FileInputStream(filePath);
                Workbook workbook = new XSSFWorkbook(fis);
                Sheet firstSheet = workbook.getSheetAt(0);
                Iterator<Row> iterator = firstSheet.iterator();
                List<CourseSectionBean> courseSectionBeansList = new ArrayList<CourseSectionBean>();

                while (iterator.hasNext()) {
                    Row nextRow = iterator.next();
                    if (nextRow.getRowNum() != 0) {
                        Iterator<Cell> cellIterator = nextRow.cellIterator();
                        CourseSectionBean courseSectionBean = new CourseSectionBean();

                        while (cellIterator.hasNext()) {
                            Cell nextCell = cellIterator.next();
                            int columnIndex = nextCell.getColumnIndex();

                            switch (columnIndex) {
                            case 0:
                                courseSectionBean
                                        .setSectionNumber(getCellValue(nextCell).toString().replace(".0", ""));
                                break;
                            case 1:
                                courseSectionBean.setCourse((String) getCellValue(nextCell));
                                break;
                            case 2:
                                courseSectionBean.setFaculty((String) getCellValue(nextCell));
                                break;

                            }

                        }
                        courseSectionBeansList.add(courseSectionBean);
                    }

                }
                workbook.close();
                fis.close();

                mainPanel.removeAll();
                mainPanel.repaint();
                CourseSectionModel model = new CourseSectionModel();
                CourseSectionJInternalFrame courseSectionFrame = new CourseSectionJInternalFrame();
                courseSectionFrame.getCourseSectionMsgLabel().setText("");
                courseSectionFrame.getAddCourseSectionButton().setVisible(true);
                courseSectionFrame.getUpdateCourseSectionButton().setVisible(false);
                courseSectionFrame.getDeleteCourseSectionButton().setVisible(false);
                //schoolFrame.getSchoolDataTable().setModel(DbUtils.resultSetToTableModel( new GradSchoolModel().getAllSchools()));
                for (CourseSectionBean courseSectionBean : courseSectionBeansList) {
                    try {
                        model.addCourseSection(courseSectionBean);
                    } catch (Exception exp) {
                        System.out.println("Exception Raised....." + exp.getMessage());
                    }
                }
                courseSectionFrame.loadDataIntoJTable();
                mainPanel.add(courseSectionFrame);
                courseSectionFrame.setVisible(true);
            } catch (Exception exp) {
                JOptionPane.showMessageDialog(null, exp.getMessage());
            }

        }
    }//GEN-LAST:event_importcourseSectionMenuItemActionPerformed

    private void CourseSectionMenuAncestorMoved(javax.swing.event.AncestorEvent evt) {//GEN-FIRST:event_CourseSectionMenuAncestorMoved
        // TODO add your handling code here:
    }//GEN-LAST:event_CourseSectionMenuAncestorMoved

    private void GenerateScheduleAncestorMoved(javax.swing.event.AncestorEvent evt) {//GEN-FIRST:event_GenerateScheduleAncestorMoved
        // TODO add your handling code here:
    }//GEN-LAST:event_GenerateScheduleAncestorMoved

    private void GenerateScheduleMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_GenerateScheduleMouseClicked
        // TODO add your handling code here:
        try {
            mainPanel.removeAll();
            mainPanel.repaint();
            GenerateScheduleJInternalFrame sheduleFrame = new GenerateScheduleJInternalFrame();
            sheduleFrame.loadDataIntoJTable();
            mainPanel.add(sheduleFrame);
            sheduleFrame.setVisible(true);

        } catch (Exception exp) {
            JOptionPane.showMessageDialog(null, "Exception Raised " + exp);
        }

    }//GEN-LAST:event_GenerateScheduleMouseClicked

    private void TestScheduleAncestorMoved(javax.swing.event.AncestorEvent evt) {//GEN-FIRST:event_TestScheduleAncestorMoved
        // TODO add your handling code here:
    }//GEN-LAST:event_TestScheduleAncestorMoved

    private void TestScheduleMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_TestScheduleMouseClicked
        // TODO add your handling code here:
        try {
            mainPanel.removeAll();
            mainPanel.repaint();
            TestScheduleJInternalFrame sheduleFrame = new TestScheduleJInternalFrame();
            mainPanel.add(sheduleFrame);
            sheduleFrame.setVisible(true);

        } catch (Exception exp) {
            JOptionPane.showMessageDialog(null, "Exception Raised " + exp);
        }
    }//GEN-LAST:event_TestScheduleMouseClicked

    private void SemesterAddMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SemesterAddMenuItemActionPerformed
        // TODO add your handling code here:

        try {
            mainPanel.removeAll();
            mainPanel.repaint();
            SemesterJInternalFrame semesterFrame = new SemesterJInternalFrame();
            semesterFrame.getSemesterMsgLabel().setText("");

            semesterFrame.getLblSemester().setVisible(true);
            semesterFrame.getLblStartDate().setVisible(true);
            semesterFrame.getLblEndDate().setVisible(true);

            semesterFrame.getSemester().setVisible(true);
            semesterFrame.getStartDate().setVisible(true);
            semesterFrame.getEndDate().setVisible(true);

            semesterFrame.getAddSemesterButton().setVisible(true);
            semesterFrame.getUpdateSemesterButton().setVisible(false);
            semesterFrame.getDeleteSemesterButton().setVisible(false);
            //schoolFrame.getSchoolDataTable().setModel(DbUtils.resultSetToTableModel( new GradSchoolModel().getAllSchools()));
            semesterFrame.loadDataIntoJTable();
            mainPanel.add(semesterFrame);
            semesterFrame.setVisible(true);

        } catch (Exception exp) {
            JOptionPane.showMessageDialog(null, "Exception Raised " + exp);
        }

    }//GEN-LAST:event_SemesterAddMenuItemActionPerformed

    private void SemesterUpdateMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SemesterUpdateMenuItemActionPerformed
        // TODO add your handling code here:

        try {
            mainPanel.removeAll();
            mainPanel.repaint();
            SemesterJInternalFrame semesterFrame = new SemesterJInternalFrame();
            semesterFrame.getSemesterMsgLabel().setText("");

            semesterFrame.getLblSemester().setVisible(true);
            semesterFrame.getLblStartDate().setVisible(true);
            semesterFrame.getLblEndDate().setVisible(true);

            semesterFrame.getSemester().setVisible(true);
            semesterFrame.getStartDate().setVisible(true);
            semesterFrame.getEndDate().setVisible(true);

            semesterFrame.getAddSemesterButton().setVisible(false);
            semesterFrame.getUpdateSemesterButton().setVisible(true);
            semesterFrame.getDeleteSemesterButton().setVisible(false);
            //schoolFrame.getSchoolDataTable().setModel(DbUtils.resultSetToTableModel( new GradSchoolModel().getAllSchools()));
            semesterFrame.loadDataIntoJTable();
            mainPanel.add(semesterFrame);
            semesterFrame.setVisible(true);

        } catch (Exception exp) {
            JOptionPane.showMessageDialog(null, "Exception Raised " + exp);
        }

    }//GEN-LAST:event_SemesterUpdateMenuItemActionPerformed

    private void SemesterDeleteMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SemesterDeleteMenuItemActionPerformed
        // TODO add your handling code here:
        // TODO add your handling code here:

        try {
            mainPanel.removeAll();
            mainPanel.repaint();
            SemesterJInternalFrame semesterFrame = new SemesterJInternalFrame();
            semesterFrame.getSemesterMsgLabel().setText("");

            semesterFrame.getLblSemester().setVisible(true);
            semesterFrame.getLblStartDate().setVisible(false);
            semesterFrame.getLblEndDate().setVisible(false);

            semesterFrame.getSemester().setVisible(true);
            semesterFrame.getStartDate().setVisible(false);
            semesterFrame.getEndDate().setVisible(false);

            semesterFrame.getAddSemesterButton().setVisible(false);
            semesterFrame.getUpdateSemesterButton().setVisible(false);
            semesterFrame.getDeleteSemesterButton().setVisible(true);
            //schoolFrame.getSchoolDataTable().setModel(DbUtils.resultSetToTableModel( new GradSchoolModel().getAllSchools()));
            semesterFrame.loadDataIntoJTable();
            mainPanel.add(semesterFrame);
            semesterFrame.setVisible(true);

        } catch (Exception exp) {
            JOptionPane.showMessageDialog(null, "Exception Raised " + exp);
        }

    }//GEN-LAST:event_SemesterDeleteMenuItemActionPerformed

    private void importSemesterMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_importSemesterMenuItemActionPerformed
        // TODO add your handling code here:
        JFileChooser jf = new JFileChooser();
        jf.setDialogTitle("Please select a excel File to import");
        int result = jf.showOpenDialog(null);
        if (result == JFileChooser.APPROVE_OPTION) {
            String filePath = jf.getSelectedFile().getAbsolutePath();

            try {
                FileInputStream fis = new FileInputStream(filePath);
                Workbook workbook = new XSSFWorkbook(fis);
                Sheet firstSheet = workbook.getSheetAt(0);
                Iterator<Row> iterator = firstSheet.iterator();
                List<SemesterBean> semesterBeansList = new ArrayList<SemesterBean>();

                while (iterator.hasNext()) {
                    Row nextRow = iterator.next();
                    if (nextRow.getRowNum() != 0) {
                        Iterator<Cell> cellIterator = nextRow.cellIterator();
                        SemesterBean semesterBean = new SemesterBean();

                        while (cellIterator.hasNext()) {
                            Cell nextCell = cellIterator.next();
                            int columnIndex = nextCell.getColumnIndex();

                            switch (columnIndex) {
                            case 0:
                                semesterBean.setSemester((String) getCellValue(nextCell));
                                break;
                            case 1:
                                String[] stringDate = getCellValue(nextCell).toString().split("/");
                                semesterBean
                                        .setStartDate(stringDate[0] + "/" + stringDate[1] + "/20" + stringDate[2]);
                                break;
                            case 2:
                                String[] stringDate2 = getCellValue(nextCell).toString().split("/");
                                semesterBean
                                        .setEndDate(stringDate2[0] + "/" + stringDate2[1] + "/20" + stringDate2[2]);
                                break;

                            }

                        }
                        semesterBeansList.add(semesterBean);
                    }

                }
                workbook.close();
                fis.close();

                mainPanel.removeAll();
                mainPanel.repaint();
                SemesterModel model = new SemesterModel();
                SemesterJInternalFrame semesterFrame = new SemesterJInternalFrame();
                semesterFrame.getSemesterMsgLabel().setText("");
                semesterFrame.getAddSemesterButton().setVisible(true);
                semesterFrame.getUpdateSemesterButton().setVisible(false);
                semesterFrame.getDeleteSemesterButton().setVisible(false);
                //schoolFrame.getSchoolDataTable().setModel(DbUtils.resultSetToTableModel( new GradSchoolModel().getAllSchools()));
                for (SemesterBean semesterBean : semesterBeansList) {
                    try {
                        model.addSemester(semesterBean);
                    } catch (Exception exp) {
                        System.out.println("Exception Raised....." + exp.getMessage());
                    }
                }
                semesterFrame.loadDataIntoJTable();
                mainPanel.add(semesterFrame);
                semesterFrame.setVisible(true);
            } catch (Exception exp) {
                JOptionPane.showMessageDialog(null, exp.getMessage());
            }

        }
    }//GEN-LAST:event_importSemesterMenuItemActionPerformed

    private void SemesterMenuAncestorMoved(javax.swing.event.AncestorEvent evt) {//GEN-FIRST:event_SemesterMenuAncestorMoved
        // TODO add your handling code here:
    }//GEN-LAST:event_SemesterMenuAncestorMoved

    private void UpdateUsersMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_UpdateUsersMenuItemActionPerformed
        // TODO add your handling code here:
        try {
            mainPanel.removeAll();
            mainPanel.repaint();
            UserJInternalFrame userFrame = new UserJInternalFrame();
            userFrame.loadDataIntoJTable();

            userFrame.getUsersMsgLabel().setText("");
            userFrame.getUserRegister().setVisible(false);
            userFrame.getUserUpdateButton().setVisible(true);
            userFrame.getUserDeleteButton().setVisible(false);

            mainPanel.add(userFrame);
            userFrame.setVisible(true);

        } catch (Exception exp) {
            JOptionPane.showMessageDialog(null, "Exception Raised " + exp);
        }
    }//GEN-LAST:event_UpdateUsersMenuItemActionPerformed

    private void DeleteUsersMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_DeleteUsersMenuItemActionPerformed
        // TODO add your handling code here:
        try {
            mainPanel.removeAll();
            mainPanel.repaint();
            UserJInternalFrame userFrame = new UserJInternalFrame();
            userFrame.loadDataIntoJTable();

            userFrame.getUsersMsgLabel().setText("");

            userFrame.getLblUsername().setVisible(true);
            userFrame.getLblPassword().setVisible(false);
            userFrame.getLblRole().setVisible(false);

            userFrame.getUsername().setVisible(true);
            userFrame.getPassword().setVisible(false);
            userFrame.getRole().setVisible(false);

            userFrame.getUserRegister().setVisible(false);
            userFrame.getUserUpdateButton().setVisible(false);
            userFrame.getUserDeleteButton().setVisible(true);

            mainPanel.add(userFrame);
            userFrame.setVisible(true);

        } catch (Exception exp) {
            JOptionPane.showMessageDialog(null, "Exception Raised " + exp);
        }
    }//GEN-LAST:event_DeleteUsersMenuItemActionPerformed

    private void ImportUsersMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ImportUsersMenuItemActionPerformed
        // TODO add your handling code here:

        JFileChooser jf = new JFileChooser();
        jf.setDialogTitle("Please select a excel File to import");
        int result = jf.showOpenDialog(null);
        if (result == JFileChooser.APPROVE_OPTION) {
            String filePath = jf.getSelectedFile().getAbsolutePath();

            try {
                FileInputStream fis = new FileInputStream(filePath);
                Workbook workbook = new XSSFWorkbook(fis);
                Sheet firstSheet = workbook.getSheetAt(0);
                Iterator<Row> iterator = firstSheet.iterator();
                List<UserBean> userBeansList = new ArrayList<UserBean>();

                while (iterator.hasNext()) {
                    Row nextRow = iterator.next();
                    if (nextRow.getRowNum() != 0) {
                        Iterator<Cell> cellIterator = nextRow.cellIterator();
                        UserBean userBean = new UserBean();

                        while (cellIterator.hasNext()) {
                            Cell nextCell = cellIterator.next();
                            int columnIndex = nextCell.getColumnIndex();

                            switch (columnIndex) {
                            case 0:
                                userBean.setLoginId(getCellValue(nextCell).toString());
                                break;
                            case 1:
                                userBean.setPassword((String) getCellValue(nextCell));
                                break;
                            case 2:
                                userBean.setRole((String) getCellValue(nextCell));
                                break;

                            }

                        }
                        userBeansList.add(userBean);
                    }

                }
                workbook.close();
                fis.close();

                mainPanel.removeAll();
                mainPanel.repaint();
                UserModel model = new UserModel();
                UserJInternalFrame userFrame = new UserJInternalFrame();
                userFrame.getUsersMsgLabel().setText("");
                userFrame.getUserRegister().setVisible(true);
                userFrame.getUserUpdateButton().setVisible(false);
                userFrame.getUserDeleteButton().setVisible(false);
                //userFrame.getSchoolDataTable().setModel(DbUtils.resultSetToTableModel( new GradSchoolModel().getAllSchools()));
                for (UserBean userBean : userBeansList) {
                    try {
                        model.registerUser(userBean);
                    } catch (Exception exp) {
                        System.out.println("Exception Raised....." + exp.getMessage());
                    }
                }
                userFrame.loadDataIntoJTable();
                mainPanel.add(userFrame);
                userFrame.setVisible(true);
            } catch (Exception exp) {
                JOptionPane.showMessageDialog(null, exp.getMessage());
            }

        }
    }//GEN-LAST:event_ImportUsersMenuItemActionPerformed

    private void AddRoomMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_AddRoomMenuItemActionPerformed
        // TODO add your handling code here:

        try {
            mainPanel.removeAll();
            mainPanel.repaint();
            RoomJInternalFrame roomFrame = new RoomJInternalFrame();
            roomFrame.loadDataIntoJTable();

            roomFrame.getRoomMsgLabel().setText("");
            roomFrame.getAddRoomButton().setVisible(true);
            roomFrame.getUpdateRoomButton().setVisible(false);
            roomFrame.getDeleteRoomButton().setVisible(false);

            mainPanel.add(roomFrame);
            roomFrame.setVisible(true);

        } catch (Exception exp) {
            JOptionPane.showMessageDialog(null, "Exception Raised " + exp);
        }
    }//GEN-LAST:event_AddRoomMenuItemActionPerformed

    private void UpdateRoomMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_UpdateRoomMenuItemActionPerformed
        // TODO add your handling code here:

        // TODO add your handling code here:

        try {
            mainPanel.removeAll();
            mainPanel.repaint();
            RoomJInternalFrame roomFrame = new RoomJInternalFrame();
            roomFrame.loadDataIntoJTable();

            roomFrame.getRoomMsgLabel().setText("");
            roomFrame.getAddRoomButton().setVisible(false);
            roomFrame.getUpdateRoomButton().setVisible(true);
            roomFrame.getDeleteRoomButton().setVisible(false);

            mainPanel.add(roomFrame);
            roomFrame.setVisible(true);

        } catch (Exception exp) {
            JOptionPane.showMessageDialog(null, "Exception Raised " + exp);
        }
    }//GEN-LAST:event_UpdateRoomMenuItemActionPerformed

    private void DeleteRoomMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_DeleteRoomMenuItemActionPerformed
        // TODO add your handling code here:
        try {
            mainPanel.removeAll();
            mainPanel.repaint();
            RoomJInternalFrame roomFrame = new RoomJInternalFrame();
            roomFrame.loadDataIntoJTable();

            roomFrame.getRoomMsgLabel().setText("");

            roomFrame.getLblCourseCode().setVisible(false);
            roomFrame.getLblCapacity().setVisible(false);

            roomFrame.getCourseCode().setVisible(false);
            roomFrame.getCapacity().setVisible(false);

            roomFrame.getAddRoomButton().setVisible(false);
            roomFrame.getUpdateRoomButton().setVisible(false);
            roomFrame.getDeleteRoomButton().setVisible(true);

            mainPanel.add(roomFrame);
            roomFrame.setVisible(true);

        } catch (Exception exp) {
            JOptionPane.showMessageDialog(null, "Exception Raised " + exp);
        }
    }//GEN-LAST:event_DeleteRoomMenuItemActionPerformed

    private void ImportRoomMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ImportRoomMenuItemActionPerformed
        // TODO add your handling code here:
        JFileChooser jf = new JFileChooser();
        jf.setDialogTitle("Please select a excel File to import");
        int result = jf.showOpenDialog(null);
        if (result == JFileChooser.APPROVE_OPTION) {
            String filePath = jf.getSelectedFile().getAbsolutePath();

            try {
                FileInputStream fis = new FileInputStream(filePath);
                Workbook workbook = new XSSFWorkbook(fis);
                Sheet firstSheet = workbook.getSheetAt(0);
                Iterator<Row> iterator = firstSheet.iterator();
                List<RoomBean> roomBeansList = new ArrayList<RoomBean>();

                while (iterator.hasNext()) {
                    Row nextRow = iterator.next();
                    if (nextRow.getRowNum() != 0) {
                        Iterator<Cell> cellIterator = nextRow.cellIterator();
                        RoomBean roomBean = new RoomBean();

                        while (cellIterator.hasNext()) {
                            Cell nextCell = cellIterator.next();
                            int columnIndex = nextCell.getColumnIndex();

                            switch (columnIndex) {
                            case 0:
                                roomBean.setRoomNumber(getCellValue(nextCell).toString());
                                break;
                            case 1:
                                roomBean.setCourseCode((String) getCellValue(nextCell));
                                break;
                            case 2:
                                roomBean.setCapacity((String) getCellValue(nextCell));
                                break;

                            }

                        }
                        roomBeansList.add(roomBean);
                    }

                }
                workbook.close();
                fis.close();

                mainPanel.removeAll();
                mainPanel.repaint();
                RoomModel model = new RoomModel();
                RoomJInternalFrame roomFrame = new RoomJInternalFrame();
                roomFrame.getRoomMsgLabel().setText("");
                roomFrame.getAddRoomButton().setVisible(true);
                roomFrame.getUpdateRoomButton().setVisible(false);
                roomFrame.getDeleteRoomButton().setVisible(false);
                //userFrame.getSchoolDataTable().setModel(DbUtils.resultSetToTableModel( new GradSchoolModel().getAllSchools()));
                for (RoomBean roomBean : roomBeansList) {
                    try {
                        model.addRoom(roomBean);
                    } catch (Exception exp) {
                        System.out.println("Exception Raised....." + exp.getMessage());
                    }
                }
                roomFrame.loadDataIntoJTable();
                mainPanel.add(roomFrame);
                roomFrame.setVisible(true);
            } catch (Exception exp) {
                JOptionPane.showMessageDialog(null, exp.getMessage());
            }

        }
    }//GEN-LAST:event_ImportRoomMenuItemActionPerformed

    private void RoomsMenuAncestorMoved(javax.swing.event.AncestorEvent evt) {//GEN-FIRST:event_RoomsMenuAncestorMoved
        // TODO add your handling code here:
    }//GEN-LAST:event_RoomsMenuAncestorMoved

    private void ReportsMenuAncestorMoved(javax.swing.event.AncestorEvent evt) {//GEN-FIRST:event_ReportsMenuAncestorMoved
        // TODO add your handling code here:
    }//GEN-LAST:event_ReportsMenuAncestorMoved

    private void ReportsMenuMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_ReportsMenuMouseClicked
        // TODO add your handling code here:
    }//GEN-LAST:event_ReportsMenuMouseClicked

    private void degreePlanReportMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_degreePlanReportMenuItemActionPerformed
        // TODO add your handling code here:
        try {
            mainPanel.removeAll();
            mainPanel.repaint();
            DegreePlanReportJInternalFrame degreePlanReportFrame = new DegreePlanReportJInternalFrame();
            degreePlanReportFrame.loadDataIntoJTable();
            mainPanel.add(degreePlanReportFrame);
            degreePlanReportFrame.setVisible(true);

        } catch (Exception exp) {
            JOptionPane.showMessageDialog(null, "Exception Raised " + exp);
        }
    }//GEN-LAST:event_degreePlanReportMenuItemActionPerformed

    private void StudentReportMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_StudentReportMenuItemActionPerformed
        // TODO add your handling code here:
        try {
            mainPanel.removeAll();
            mainPanel.repaint();
            StudentReportJInternalFrame studentReportFrame = new StudentReportJInternalFrame();
            studentReportFrame.loadDataIntoJTable();
            mainPanel.add(studentReportFrame);
            studentReportFrame.setVisible(true);

        } catch (Exception exp) {
            JOptionPane.showMessageDialog(null, "Exception Raised " + exp);
        }
    }//GEN-LAST:event_StudentReportMenuItemActionPerformed

    private void ScheduleReportMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ScheduleReportMenuItemActionPerformed
        // TODO add your handling code here:

        try {
            mainPanel.removeAll();
            mainPanel.repaint();
            ScheduleReportJInternalFrame sheduleReportFrame = new ScheduleReportJInternalFrame();
            sheduleReportFrame.loadDataIntoJTable();
            mainPanel.add(sheduleReportFrame);
            sheduleReportFrame.setVisible(true);

        } catch (Exception exp) {
            JOptionPane.showMessageDialog(null, "Exception Raised " + exp);
        }
    }//GEN-LAST:event_ScheduleReportMenuItemActionPerformed

    private Object getCellValue(Cell cell) {
        switch (cell.getCellType()) {
        case Cell.CELL_TYPE_STRING:
            return cell.getStringCellValue();

        case Cell.CELL_TYPE_BOOLEAN:
            return cell.getBooleanCellValue();

        case Cell.CELL_TYPE_NUMERIC:
            DataFormatter df = new DataFormatter();
            String stringCellValue = df.formatCellValue(cell);
            return stringCellValue;
        }

        return null;
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(GSECSFrame.class.getName()).log(java.util.logging.Level.SEVERE, null,
                    ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(GSECSFrame.class.getName()).log(java.util.logging.Level.SEVERE, null,
                    ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(GSECSFrame.class.getName()).log(java.util.logging.Level.SEVERE, null,
                    ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(GSECSFrame.class.getName()).log(java.util.logging.Level.SEVERE, null,
                    ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                GSECSFrame frame = new GSECSFrame();
                frame.setVisible(true);

            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JCheckBoxMenuItem AddRoomMenuItem;
    private javax.swing.JCheckBoxMenuItem AddUsersMenuItem;
    private javax.swing.JMenu CourseMenu;
    private javax.swing.JMenu CourseSectionMenu;
    private javax.swing.JMenuItem DeleteRoomMenuItem;
    private javax.swing.JMenuItem DeleteUsersMenuItem;
    private javax.swing.JMenu FacultyMenu;
    private javax.swing.JMenu GenerateSchedule;
    private javax.swing.JMenu GradSchoolMenu;
    private javax.swing.JMenuItem ImportRoomMenuItem;
    private javax.swing.JMenuItem ImportUsersMenuItem;
    private javax.swing.JMenuBar MenuBar;
    private javax.swing.JMenu ReportsMenu;
    private javax.swing.JMenu RoomsMenu;
    private javax.swing.JMenuItem ScheduleReportMenuItem;
    private javax.swing.JCheckBoxMenuItem SemesterAddMenuItem;
    private javax.swing.JMenuItem SemesterDeleteMenuItem;
    private javax.swing.JMenu SemesterMenu;
    private javax.swing.JMenuItem SemesterUpdateMenuItem;
    private javax.swing.JMenuItem StudentReportMenuItem;
    private javax.swing.JMenu TestSchedule;
    private javax.swing.JMenuItem UpdateRoomMenuItem;
    private javax.swing.JMenuItem UpdateUsersMenuItem;
    private javax.swing.JMenu UsersMenu;
    private javax.swing.JCheckBoxMenuItem courseAddMenuItem1;
    private javax.swing.JMenuItem courseDeleteMenuItem;
    private javax.swing.JCheckBoxMenuItem courseSectionAddMenuItem;
    private javax.swing.JMenuItem courseSectionDeleteMenuItem;
    private javax.swing.JMenuItem courseSectionUpdateMenuItem;
    private javax.swing.JMenuItem courseUpdateMenuItem;
    private javax.swing.JCheckBoxMenuItem degreePlanAddButton;
    private javax.swing.JMenuItem degreePlanDeleteButton;
    private javax.swing.JMenu degreePlanMenu;
    private javax.swing.JMenuItem degreePlanReportMenuItem;
    private javax.swing.JMenuItem degreePlanUpdateButton;
    private javax.swing.JCheckBoxMenuItem facultyAddMenuItem;
    private javax.swing.JMenuItem facultyDeleteMenuItem1;
    private javax.swing.JMenuItem facultyImportMenuItem;
    private javax.swing.JMenuItem facultyUpdateMenuItem1;
    private javax.swing.JMenuItem importCourseMenuItem;
    private javax.swing.JMenuItem importDegreePlanMenuItem;
    private javax.swing.JMenuItem importSchoolData;
    private javax.swing.JMenuItem importSemesterMenuItem;
    private javax.swing.JMenuItem importStudentCourseMenuItem;
    private javax.swing.JMenuItem importStudentMenuItem;
    private javax.swing.JMenuItem importcourseSectionMenuItem;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JMenu logOutMenuButton;
    private javax.swing.JDesktopPane mainPanel;
    private javax.swing.JCheckBoxMenuItem schoolAddMenuItem;
    private javax.swing.JMenuItem schoolDeleteMenuItem;
    private javax.swing.JMenuItem schoolUpdateMenuItem;
    private javax.swing.JCheckBoxMenuItem studentAddMenuItem;
    private javax.swing.JCheckBoxMenuItem studentCourseAddMenuItem;
    private javax.swing.JMenuItem studentCourseDeleteMenuItem;
    private javax.swing.JMenu studentCourseMenu;
    private javax.swing.JMenuItem studentCourseUpdateMenuItem;
    private javax.swing.JMenuItem studentDeleteMenuItem;
    private javax.swing.JMenu studentMenu;
    private javax.swing.JMenuItem studentUpdateMenuItem;
    // End of variables declaration//GEN-END:variables
}