jQuery in Action, 2nd edition*
The moose likes Swing / AWT / SWT and the fly likes JPassowrldField Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JPassowrldField" Watch "JPassowrldField" New topic
Author

JPassowrldField

Larry Lai
Ranch Hand

Joined: May 13, 2002
Posts: 44
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

Joined: May 17, 2001
Posts: 2823
String password = new String(passwordTextField.getPassword()).trim();
if (password.equals(someStoredPassword)) {
//allow login
} else {
//invalid password
}
 
wood burning stoves
 
subject: JPassowrldField