aspose file tools*
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 Spring in Action this week in the Spring 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
}
 
jQuery in Action, 2nd edition
 
subject: JPassowrldField