// Handle the adding of a User in the Database public void addUserButtonClicked(String nick, String pass, String email) { try { FU.addUser(nick, pass, email); } catch (EmptyFieldsException e) { JOptionPane.showMessageDialog( null, "Enter a nickname and a password.", "Add a User", JOptionPane.ERROR_MESSAGE); } catch (ObjectCreatedException e) { if ((addUserRole.getSelectedItem()).equals("Admin")) { FU.chooseUserRoleAdmin(nick); } else if ((addUserRole.getSelectedItem()).equals("Simple User")) { FU.chooseUserRoleSimpleUser(nick); } else if ((addUserRole.getSelectedItem()).equals("Seller")) { FU.chooseUserRoleSeller(nick); } JOptionPane.showMessageDialog( null, nick + " is now registered into the DB !", "Add a User", JOptionPane.INFORMATION_MESSAGE); } catch (ObjectAlreadyExistsException e) { JOptionPane.showMessageDialog( null, nick + " already exists into the DB.", "Add a User", JOptionPane.ERROR_MESSAGE); } }