Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Regarding Login

 
adeeb alexander
Ranch Hand
Posts: 268
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have created a panel on which there is one text field and one password field and below them is a button. This i have done in cardlayout. Actually what i want is, if i all ready store the text in two strings one for name and other for password and if i enter the same thing what i have stored using string in the program and click the button i should go to next card. I only need how to get the data from the fields and compare it with the stored text. Then rest of the things i can handle. So please somebody help me out.
 
Ted Smyth
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by adeeb alexander:
Hi,
I have created a panel on which there is one text field and one password field and below them is a button. This i have done in cardlayout. Actually what i want is, if i all ready store the text in two strings one for name and other for password and if i enter the same thing what i have stored using string in the program and click the button i should go to next card. I only need how to get the data from the fields and compare it with the stored text. Then rest of the things i can handle. So please somebody help me out.


If memory serves, there are two methods in JPasswordField for retrieving the entered value: getPassword() and getText().

getPassword() returns a char[] that is has been hashed (to obscure the actual password value)

getText() returns the actual password that was entered

So compare them...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!