Group group = mainFrame.getGroupSelected(); if (group == null) { group = mainFrame.getModel().getTimetable().getGroup(); if (group == null) return; }  int select = JOptionPane.showConfirmDialog(null, "Voulez-vous vraiment supprimer le groupe '"+group.getHeading()+"'", "Confirmation", JOptionPane.YES_NO_OPTION); if (select == JOptionPane.YES_OPTION) { Timetable timetable = mainFrame.getModel().getTimetable(); try { group = DaoManager.getGroupDao().getGroup(group, new String[] {GroupDao.JOIN_STUDENTS, GroupDao.JOIN_SUBJECTS_COURSES_TAKEPART}); if (group.getSubjectsCoursesTakePart().size() > 0) { select = JOptionPane.showConfirmDialog(null, "Des cours sont lis  ce groupe.\nLa suppression du groupe supprima aussi les cours lis.\nContinuer ?", "Confirmation", JOptionPane.YES_NO_OPTION); if (select == JOptionPane.NO_OPTION) return; for (Iterator i = group.getSubjectsCoursesTakePart().iterator(); i.hasNext(); ) { Course course = new Course(((TakePartGroupSubjectCourse) i.next()).getIdCourse()); course = DaoManager.getTimetableDao().getCourse(course, new String[] {TimetableDao.JOIN_TEACHERS_DIRECTING, TimetableDao.JOIN_GROUPS_SUBJECTS}); DaoManager.getTimetableDao().removeCourse(course); timetable.removeCourse(course); mainFrame.getModel().fireRefreshCourse(course, BoTModel.TYPE_REMOVE); } }  DaoManager.getGroupDao().removeGroup(group);  mainFrame.getModel().fireRefreshGroup(group, BoTModel.TYPE_REMOVE); if (mainFrame.getGroupSelected() == null) mainFrame.getModel().fireCloseTimetable();  JOptionPane.showMessageDialog(null, "Suppression effectue avec succs", "Information", JOptionPane.INFORMATION_MESSAGE); } catch (Exception e) { JOptionPane.showMessageDialog(null, "Une erreur interne est survenue", "Erreur", JOptionPane.ERROR_MESSAGE); } }
    public void actionPerformed(ActionEvent arg0) {    }