public JPanel getGUI() {
        JPanel p1;

        button1 = new JButton("Add Question");
        button1.addActionListener(this);
        
        addquestionButton1 = new JButton("Set a MCQ Question");
        addquestionButton1.addActionListener(this);
        addquestionButton2 = new JButton("Set a FIB Question");
        addquestionButton2.addActionListener(this);
        //columnNames for the table
        String[] columnNames = {
            "ID",
            "Type",
            "Question",
            ""};
        //get data from database
        Object[][] data = getData();
        //create jtable
        table1 = new JTable(data, columnNames);

        table1.setShowHorizontalLines(true);
        table1.getColumnModel().getColumn(2).setMaxWidth(50);

        table1.setDefaultRenderer(Object.class, new DefaultTableCellRenderer() {

            @Override
            public Component getTableCellRendererComponent(JTable table,
                    Object value, boolean isSelected, boolean hasFocus,
                    int row, int column) {
//            try {
//            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
//                if ("Nimbus".equals(info.getName())) {
//                    UIManager.setLookAndFeel(
//            UIManager.getSystemLookAndFeelClassName());
//                    break;
//                }
//            }
//        } catch (ClassNotFoundException ex) {
//
//
//            java.util.logging.Logger.getLogger(ChooseQuestionsPanel.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//        } catch (InstantiationException ex) {
//            java.util.logging.Logger.getLogger(ChooseQuestionsPanel.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//        } catch (IllegalAccessException ex) {
//            java.util.logging.Logger.getLogger(ChooseQuestionsPanel.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
//            java.util.logging.Logger.getLogger(ChooseQuestionsPanel.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//
//        }
                Component c = super.getTableCellRendererComponent(table,
                        value, isSelected, hasFocus, row, column);
                c.setBackground(row % 2 == 0 ? Color.lightGray : new Color(163, 159, 159));
                return c;
            }
        ;
        });
                 
        //set selectionMode
        table1.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
        //turn the last column from text to checkbox
        table1.getColumnModel().getColumn(3).setCellRenderer(new TableCellRenderer() {

            @Override
            public Component getTableCellRendererComponent(JTable table, Object value,
                    boolean isSelected, boolean hasFocus, int row, int column) {
//                try {
//            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
//                if ("Nimbus".equals(info.getName())) {
//                    UIManager.setLookAndFeel(
//            UIManager.getSystemLookAndFeelClassName());
//                    break;
//                }
//            }
//        } catch (ClassNotFoundException ex) {
//
//
//            java.util.logging.Logger.getLogger(ChooseQuestionsPanel.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//        } catch (InstantiationException ex) {
//            java.util.logging.Logger.getLogger(ChooseQuestionsPanel.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//        } catch (IllegalAccessException ex) {
//            java.util.logging.Logger.getLogger(ChooseQuestionsPanel.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
//            java.util.logging.Logger.getLogger(ChooseQuestionsPanel.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//
//        }
                JCheckBox ck = new JCheckBox();
                //ck.setBackground(row%2==0 ? Color.lightGray : new Color(163, 159, 159));      
                ck.setSelected(isSelected);
                ck.setHorizontalAlignment(0);
                table.setShowHorizontalLines(true);
                return ck;
            }
        });

        p1 = new JPanel();
        p1.setLayout(new BoxLayout(p1, BoxLayout.Y_AXIS));
        table1.setShowVerticalLines(true);
        table1.getColumnModel().getColumn(0).setMaxWidth(60);
        table1.getColumnModel().getColumn(0).setMinWidth(40);
        table1.getColumnModel().getColumn(0).setPreferredWidth(50);
        table1.getColumnModel().getColumn(1).setMaxWidth(60);
        table1.getColumnModel().getColumn(1).setMinWidth(40);
        table1.getColumnModel().getColumn(1).setPreferredWidth(50);
        table1.getColumnModel().getColumn(2).setMaxWidth(1000);
        table1.getColumnModel().getColumn(2).setMinWidth(1000);
        table1.getColumnModel().getColumn(2).setPreferredWidth(1000);
        table1.getColumnModel().getColumn(3).setMaxWidth(30);
        table1.getColumnModel().getColumn(3).setMinWidth(10);
        table1.getColumnModel().getColumn(3).setPreferredWidth(20);

        table1.setPreferredSize(new Dimension((int) width, 10000));
        p1.add(new JScrollPane(table1));
        JPanel p = new JPanel();
        p.setLayout(new FlowLayout());
        p.setMaximumSize(new Dimension((int) width, 30));
        p.setMaximumSize(new Dimension((int) width, 30));
        p.add(button1, CENTER_ALIGNMENT);
        p.add(addquestionButton1, CENTER_ALIGNMENT);
        p.add(addquestionButton2, CENTER_ALIGNMENT);
        p1.add(p);

        return p1;

    }