AddModifyUserWindow window = new AddModifyUserWindow(type);
AddModifyUserWindow window = new AddModifyUserWindow(type, AddModifyUserWindow.TYPE_ADD);
    public void actionPerformed(ActionEvent arg0) {        AddModifyUserWindow window = new AddModifyUserWindow(type);        window.show();                if (window.isOk()) {            User user = new User();            user.setName(window.getName());            user.setFirstName(window.getSurname());            user.setEMail(window.getCourrielMail());            user.setBuildingNameForOffice(window.getBuilding());            user.setOfficeName(window.getLocal());            user.setTelephone(window.getPhone());            user.setUserType(type);            user.setFormationsInCharge(window.getFormations());                        try {                String login = generateLogin(window.getName(), window.getSurname());                user.setLogin(login);                String password = generatePassword(8);                MessageDigest md = MessageDigest.getInstance("MD5");                md.update(password.getBytes());                user.setPassword(new String(md.digest()));                user = DaoManager.getUserDao().addUser(user);                                mainFrame.getModel().fireRefreshUser(user, BoTModel.TYPE_ADD);                                JOptionPane.showMessageDialog(null, "Ajout effectu avec succs\nLogin: "+login+"\nMot de passe: "+password, "Login et mot de passe", JOptionPane.INFORMATION_MESSAGE);            } catch (Exception e) {                JOptionPane.showMessageDialog(null, "Une erreur interne est survenue", "Erreur", JOptionPane.ERROR_MESSAGE);            }        }    }