private void createComboClass() {
        int count = 0;
        for (Classes cla : classlist) {
            if (model.findClassTypeById(cla.getClassTypeid()).getName().equals
               ( ((Room) comboRoom.getSelectedItem()).getRoomType()) ){
                if (c != null) {
                    if (count == 0) {

                        comboClass.addItem(c);
                        count++;
                    }
                } else {
                    comboClass.addItem(cla);
                    count++;
                }
            }
        }
        System.out.println(count);
        if (count >= 1) {
            comboLength.addItem("45'");
            comboLength.addItem("60'");
          


            comboClass.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    if (((Classes) comboClass.getSelectedItem()) != null) {
                        if (((Classes) comboClass.getSelectedItem()).getHour() == 45) {
                            comboLength.setSelectedIndex(0);
                        }
                        if (((Classes) comboClass.getSelectedItem()).getHour() == 60) {
                            comboLength.setSelectedIndex(1);
                        }
//                        if (((Classes) comboClass.getSelectedItem()).getHour() == 2) {
//                            comboLength.setSelectedIndex(2);
//                        }
//                        if (((Classes) comboClass.getSelectedItem()).getHour() == 2.5) {
//                            comboLength.setSelectedIndex(3);
//                        }
//                        if (((Classes) comboClass.getSelectedItem()).getHour() == 3) {
//                            comboLength.setSelectedIndex(4);
//                        }
                    }
                    timeTableGrid.removeAll();
                    setCells();
                    repaintAll();
                    setGridLayOut();
                }
            });

            if (!classlist.isEmpty()) {
                comboClass.setSelectedIndex(0);
              
            }

//            if (c!=null) {
//                comboClass.setSelectedItem(c);
//            }
        }
    }