AddModifyElementWindow window = new AddModifyElementWindow(ElementDao.TYPE_MATERIAL);
AddModifyElementWindow window = new AddModifyElementWindow(ElementDao.TYPE_MATERIAL, AddModifyElementWindow.TYPE_MODIFY);
    public void actionPerformed(ActionEvent arg0) {        Material material = mainFrame.getMaterialSelected();        if (material == null) {            material = mainFrame.getModel().getTimetable().getMaterial();            if (material == null)                return;        }        AddModifyElementWindow window = new AddModifyElementWindow(ElementDao.TYPE_MATERIAL);        window.setEquipmentName(material.getName());        window.setDescriptionEquipment(material.getDescription());        window.show();                if (window.isOk()) {            material.setName(window.getEquipmentName());            material.setDescription(window.getDescriptionEquipment());            try {                DaoManager.getElementDao().modifyMaterial(material);                                mainFrame.getModel().fireRefreshMaterial(material, BoTModel.TYPE_MODIFY);                                JOptionPane.showMessageDialog(null, "Modification effectue avec succs", "Information", JOptionPane.INFORMATION_MESSAGE);            } catch (Exception e) {                JOptionPane.showMessageDialog(null, "Une erreur interne est survenue", "Erreur", JOptionPane.ERROR_MESSAGE);            }        }    }