I have 4 textboxes, 2 of them being password boxes (for the user to confirm their password).
Here's my code:
public void actionPerformed(ActionEvent arg0) {
    String username = usernameField.getText();
    String emailAddress = emailField.getText();
    String password1 = passwordField1.getText();
    String password2 = passwordField2.getText();
    if (password1 != password2) {
        [code here]
    }
}
How can I make it so that if the passwords aren't equal it stops the rest of the code in that method from executing?
 
     
     
     
     
    