private void logInButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_logInButtonActionPerformed
        String password = new String(passwordField.getPassword());
        int response = server.logIn(usernameField.getText(), password);
        if(response == 102){
            JOptionPane.showMessageDialog(rootPane, "Error " + response + " - " + usernameField.getText() + " is already logged in.");
        }
        else if(response == 103){
            int response2 = server.sendIP(usernameField.getText());
            if(response2 == 110){
                JOptionPane.showMessageDialog(rootPane, usernameField.getText() + " successfully logged in.");
                server.setCurrentUser(usernameField.getText());
                server.getBuddyList(usernameField.getText());
                setVisible(false);
                MainWindowDialog mainWindow = new MainWindowDialog(parent, true, server);
                mainWindow.setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
                mainWindow.setVisible(true);
            }
            else{
                JOptionPane.showMessageDialog(rootPane, "Couldn't send IP Address successfully.");
            }
        }
        else if(response == 108){
            JOptionPane.showMessageDialog(rootPane, "The username " + usernameField.getText() + " does not exist.");
        }
        else if(response == 109){
            JOptionPane.showMessageDialog(rootPane, "The passwords did not match.");
        }
        else{
            JOptionPane.showMessageDialog(rootPane, "Error: Did not recieve error/message code.");
        }
    }//GEN-LAST:event_logInButtonActionPerformed