get password from password field

1.1k Views Asked by At

I have put a Password Field on my frame. I have named it pwText(Variable name). I am unable to get the input from the Password Field so that I can do a comparison.

Please note that the password that need to be entered is "userjim".

1

There are 1 best solutions below

0
On
String password = new String(pwText.getPassword());
if (password.equals("userjim") {
    // correct
} else {
    // not correct
}