Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

jPasswordField is not working please help..  RSS feed

 
Soumya Rout
Ranch Hand
Posts: 49
Java Java ME Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
In a login applcation i have used the jPasswordField control. To retrieve the user input i've used as usual method getText(). And after getting the value will be compared with the database.

but first i cant retrive text from the passwordfield


please anyone tell me how this problem can be sort out.



regards



som
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use JPasswordField#getPassword() instead.
 
Soumya Rout
Ranch Hand
Posts: 49
Java Java ME Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry ive given the control name. i have changed the Jpasswordfield name and its working now..
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Even then, you should not be using getText()
From the JPasswordField API
Deprecated. As of Java 2 platform v1.2, replaced by getPassword.
Returns the text contained in this TextComponent. If the underlying document is null, will give a NullPointerException.
For security reasons, this method is deprecated. Use the * getPassword method instead.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!