user2128318
user2128318

Reputation: 47

get password from password field

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".

Upvotes: -2

Views: 1156

Answers (1)

PurkkaKoodari
PurkkaKoodari

Reputation: 6809

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

Upvotes: 2

Related Questions