private void setExamListPanel() {

        getExams();

        isPublicButtons = new JButton[exams.size()];
        examSelected = new JCheckBox[exams.size()];

        examLabels = new JLabel[exams.size()];

        for (int i = 1; i < exams.size() + 1; i++) {
            sols.Model.Exam exam = exams.get(i - 1);

            examLabels[i - 1] = new JLabel("Exam" + i);
            //Checkboxes
            examSelected[i - 1] = new JCheckBox();
            examSelected[i - 1].setName(exam.getExam_ID() + "");
            examSelected[i - 1].addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    JCheckBox cbLog = (JCheckBox) e.getSource();

                    if (cbLog.isSelected()) {
                        for (int i = 0; i < examSelected.length; i++) {
                            if (!(examSelected[i] == e.getSource())) {
                                examSelected[i].setEnabled(false);
                            }
                        }
                    } else {
                        for (int i = 0; i < examSelected.length; i++) {
                            examSelected[i].setEnabled(true);
                        }
                    }
                }
            });
            //isPublicButton
            if (exam.getIsPublic()) {
                isPublicButtons[i - 1] = new JButton("Activated");
                isPublicButtons[i - 1].setEnabled(false);
                Dimension s = isPublicButtons[i - 1].getSize();
                System.out.println(s);
            } else {
                isPublicButtons[i - 1] = new JButton("Activate");
                isPublicButtons[i - 1].setVisible(false);
            }
            isPublicButtons[i - 1].setName(exam.getExam_ID() + "");
            isPublicButtons[i - 1].addActionListener(this);

        }
        
        /**
         * 
         * setlayout
        */
        //p2.setLayout(new GridLayout(sections.size(),3));
        GroupLayout groupLayout;
        GroupLayout.ParallelGroup horizontalGroup_P;
        GroupLayout.SequentialGroup verticalGroup_S;

        groupLayout = new GroupLayout(ExamListPanel);

        groupLayout.setAutoCreateContainerGaps(
                true);
        groupLayout.setAutoCreateGaps(
                true);

        horizontalGroup_P = groupLayout.createParallelGroup();
        verticalGroup_S = groupLayout.createSequentialGroup();

        for (int i = 0;
                i < exams.size();
                i++) {
//            ExamListPanel.add(sectionLabels[i]);
//            ExamListPanel.add(buttons[i]);
//            ExamListPanel.add(deleteButtons[i]);
            horizontalGroup_P.addGroup(groupLayout.createSequentialGroup()
                    .addComponent(examSelected[i])
                    .addComponent(examLabels[i])
                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 10, Short.MAX_VALUE)
                    .addComponent(isPublicButtons[i]));

            verticalGroup_S.addGroup(groupLayout.createParallelGroup()
                    .addComponent(examSelected[i])
                    .addComponent(examLabels[i])
                    .addComponent(isPublicButtons[i])
                    .addGap(40));
        }

        groupLayout.setHorizontalGroup(horizontalGroup_P);

        groupLayout.setVerticalGroup(verticalGroup_S);

        ExamListPanel.setLayout(groupLayout);

        ExamListPanel.revalidate();
        //p2.repaint();

    }