Subject subject = mainFrame.getSubjectSelected(); if (subject == null) return;  int select = JOptionPane.showConfirmDialog(null, "Voulez-vous vraiment supprimer la matire '"+subject.getHeading()+"'", "Confirmation", JOptionPane.YES_NO_OPTION); if (select == JOptionPane.YES_OPTION) { Timetable timetable = mainFrame.getModel().getTimetable(); Collection courses = timetable.getCourses(subject); try { if (courses.size() > 0) { select = JOptionPane.showConfirmDialog(null, "Des cours sont lis  cette matire.\nLa suppression de la matire supprima aussi les cours lis.\nContinuer ?", "Confirmation", JOptionPane.YES_NO_OPTION); if (select == JOptionPane.NO_OPTION) return; for (Iterator i = courses.iterator(); i.hasNext(); ) { Course course = (Course) i.next(); DaoManager.getTimetableDao().removeCourse(course); timetable.removeCourse(course); mainFrame.getModel().fireRefreshCourse(course, BoTModel.TYPE_REMOVE); } }  DaoManager.getTimetableDao().removeSubject(subject); timetable.removeSubject(subject); mainFrame.getModel().fireRefreshSubject(subject, BoTModel.TYPE_REMOVE);  JOptionPane.showMessageDialog(null, "Suppression effectue avec succs", "Information", JOptionPane.INFORMATION_MESSAGE); } catch (Exception e) { e.printStackTrace(); JOptionPane.showMessageDialog(null, "Une erreur interne est survenue", "Erreur", JOptionPane.ERROR_MESSAGE); } }
    public void actionPerformed(ActionEvent arg0) {    }