AddModifyElementWindow window = new AddModifyElementWindow(ElementDao.TYPE_MATERIAL);
AddModifyElementWindow window = new AddModifyElementWindow(ElementDao.TYPE_MATERIAL, AddModifyElementWindow.TYPE_ADD);
    public void actionPerformed(ActionEvent arg0) {        AddModifyElementWindow window = new AddModifyElementWindow(ElementDao.TYPE_MATERIAL);        window.show();                if (window.isOk()) {            Material material = new Material();            material.setName(window.getEquipmentName());            material.setDescription(window.getDescriptionEquipment());                        try {                DaoManager.getElementDao().addMaterial(material);                                mainFrame.getModel().fireRefreshMaterial(material, 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);            }        }    }