Java Error, please assist?

individual boolean checkPassword()
whenever (textRPassword.getText().equals
(textPswd.getText()));
labelRPassword.setForeground
(Color.BLACK); //Password is definitely correct
come back true;
otherwise
labelRPassword.setForeground
(Color.RED); //Password isn’t correct
come back false;

The problem is with the “else”, saying that there isn’t any if statement for it, the in the event statement performs correctly merely comment away the other than them, but We would like both to operate for this, any aid appreciated, Thanks a lot.

+add
this would work whenever textPhone is often a string variable
if this can be a text field then you definately should get its value and then store within a string textPhone
individual boolean checkNumber()
whenever (textPhone.startsWith(“972”) textPhone.startsWith(“214”)
labelPhone.setForeground(Color.BLACK);
come back true;
else
labelPhone.setForeground(Color.RED);

if this is copied in addition to pasted
then the problem is if();
there is a semicolon there, probably don’t want it there.

Leave a Reply