Object selectedItem = userComboBox.getSelectedItem();
if (selectedItem == null) {
showWarningMessage("Select the user whose password you want to reset.", resetButton);
return;
}
User user = (User) selectedItem;
if (showConfirmMessage("Are you sure you want to reset the password for user: '" + user.getUsername() + "'?")) {
try {
user.setPassword(passwordField.getPassword());
persistenceManager.modifyUser(user);
showInformationMessage("Done!", resetButton);
} catch (PersistenceManagerException ex) {
Logger.getLogger(ManagePermissionsDialog.class.getName()).log(Level.SEVERE, null, ex);
showErrorMessage(ex.getMessage(), resetButton);