@Override
    public void actionPerformed(ActionEvent e) {
        if (e.getSource()==subsectionButton1) {//add a question
            ChooseQuestionsPanel chooseQuestionsPanel=new ChooseQuestionsPanel((SubsectionPanel)this);
            chooseQuestionsPanel.setVisible(true);
        }if (e.getSource()==subsectionButton2) {//cancel
            //remove current panel form the parent panel
            this.setVisible(false);
            this.getParent().remove(this);
            this.invalidate();
        }
    }