Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JPassowrldField

 
Larry Lai
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,
How're you ?

Do you know how to make the password in the JPasswordField getting the actionperform
then matching that "Javaranch" is the password
then if it's "Javaranch", log on.
Thanks..
Larry
 
Paul Stevens
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
String password = new String(passwordTextField.getPassword()).trim();
if (password.equals(someStoredPassword)) {
//allow login
} else {
//invalid password
}
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic