@Override
    public void actionPerformed(ActionEvent e) {
        if (e.getSource() == button1) {
            int[] ints = table1.getSelectedRows();
            
            for (int rowNum : ints) {
                if (fatherPanelState == 0) {
                    ((SectionPanel) fatherPanel).addQ(new QuestionPanel((int) table1.getValueAt(rowNum, 0), typeToInt((String)table1.getValueAt(rowNum, 1))));
                    ((SectionPanel) fatherPanel).subQPanelRepaint();
                } else {
                    ((SubsectionPanel) fatherPanel).addQ(new QuestionPanel((int) table1.getValueAt(rowNum, 0), typeToInt((String)table1.getValueAt(rowNum, 1))));
                    ((SubsectionPanel) fatherPanel).subQPanelRepaint();
                }

            }
            this.dispose();

        }else if (e.getSource() == addquestionButton1) {
            AddQuestion addQuestion = new AddQuestion(AddQuestion.addingState.WHENEDITSECTIONS, this);
            addQuestion.setVisible(true);
            addQuestion.setDefaultCloseOperation(this.DISPOSE_ON_CLOSE);
            //this.setVisible(false);

        } else if (e.getSource() == addquestionButton2) {
//            AddQuestion addQuestion = new AddQuestion(AddQuestion.addingState.WHENEDITSECTIONS, this);
//            addQuestion.setVisible(true);
//            addQuestion.setDefaultCloseOperation(this.DISPOSE_ON_CLOSE);
            AddQuestionFib addQuestionFib=new AddQuestionFib(AddQuestionFib.addingState.WHENEDITSECTIONS,this);
            addQuestionFib.setVisible(true);
            addQuestionFib.setDefaultCloseOperation(this.DISPOSE_ON_CLOSE);
            //this.setVisible(false);

        }
    }