private void registerButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_registerButtonActionPerformed
        String password = new String(passwordField.getPassword());
        String confirmPassword = new String(confirmPasswordField.getPassword());
        if(password.equals(confirmPassword)){
            int response = server.register(usernameField.getText(), password);
            if(response == 100){
                JOptionPane.showMessageDialog(rootPane, "Error " + response + " - A user with that name already exists.");
            }
            else if(response == 101){
                JOptionPane.showMessageDialog(rootPane, "Successfully added " + usernameField.getText() + " to the user list.");
                setVisible(false);
                LoginDialog logInDialog = new LoginDialog(parent, true, server);
                logInDialog.setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
                logInDialog.setVisible(true);
            }
            else{
                JOptionPane.showMessageDialog(rootPane, "Did not get a response from the server.");
            }
        }
        else{
            JOptionPane.showMessageDialog(rootPane, "The passwords did not match, please try again.");
        }
    }//GEN-LAST:event_registerButtonActionPerformed