Matt Gerrans
Posts: 1153
Nickname: matt
Registered: Feb, 2002
|
|
Re: how do you verify a password?
|
Posted: Mar 22, 2002 12:23 PM
|
|
Looks like you are only verifying the user name, not the password.
You've got a few problems here: - Why do you need to do "e.getSource()==loginBtn"? Why not just add an ActionListenter to the button? Then there will be no ambiguity about the source of the action. You may also want to have an action associated with the password entry (or make the button default) so someone can enter a user name and password and hit the enter key. - You get the name String as s, but then later you are using nameTxt.getText(). I would consistently use one or the other, so as to avoid confusing things. - It appears that you really want to allow only the user name (not password) of "tange" -- if that is the case, you need to use s.equals("tange") to see if that was the named entered.
|
|