• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Regarding Login

 
Ranch Hand
Posts: 268
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Your mother is a hamster and your father smells of tiny ads!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic