AddModifySubjectWindow window = new AddModifySubjectWindow();
AddModifySubjectWindow window = new AddModifySubjectWindow(AddModifySubjectWindow.TYPE_ADD);
    public void actionPerformed(ActionEvent arg0) {        AddModifySubjectWindow window = new AddModifySubjectWindow();        window.show();                if (window.isOk()) {            Subject subject = new Subject();            subject.setHeading(window.getIntitule());            subject.setIdTeacher(window.getTeacher().getIdUser());            subject.setNbMagHours(window.getNbMagHours());            subject.setNbTdHours(window.getNbTdHours());            subject.setNbTpHours(window.getNbTpHours());            subject.setNbMagGroups(window.getNbMagGroups());            subject.setNbTdGroups(window.getNbTdGroups());            subject.setNbTpGroups(window.getNbTpGroups());                        subject.setIdFormation(mainFrame.getFormationSelected().getIdFormation());                        //TODO manque les diffrents groupes ...                        try {                DaoManager.getTimetableDao().addSubject(subject);                                mainFrame.getModel().fireRefreshSubject(subject, BoTModel.TYPE_ADD);                                JOptionPane.showMessageDialog(null, "Ajout effectu avec succs", "Information", JOptionPane.INFORMATION_MESSAGE);            } catch (Exception e) {                JOptionPane.showMessageDialog(null, "Une erreur interne est survenue", "Erreur", JOptionPane.ERROR_MESSAGE);            }        }    }