Please can someone help? Im not sure why this if statement wont work, does anyone have any idea?
all i want it to do is if the username and password match close the current gui window and open another.
At the mo when the username and password are correct it still says incorrect.
Im sure its something really silly.
String username = usernameField.getText();
char[] password = passwordField.getPassword();
username = username.toLowerCase();
String passwordString = new String (password);
passwordString = passwordString.toLowerCase();
String loginUsername = "cj410";
String loginPassword = "email";
if (username == loginUsername && passwordString == loginPassword){
dispose();
homePage hp = new homePage();
hp.setVisible(true);
} else {
LoginError le = new LoginError();
le.setVisible(true);
}