-2

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

iPhoneProcessor
  • 4,980
  • 6
  • 27
  • 49
user2128318
  • 47
  • 1
  • 5

1 Answers1

2
String password = new String(pwText.getPassword());
if (password.equals("userjim") {
    // correct
} else {
    // not correct
}
Sergey Glotov
  • 20,200
  • 11
  • 84
  • 98
PurkkaKoodari
  • 6,703
  • 6
  • 37
  • 58