Reputation: 47
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
Reputation: 6809
String password = new String(pwText.getPassword());
if (password.equals("userjim") {
// correct
} else {
// not correct
}
Upvotes: 2