Hi, i am a beginner in java. i have to put two text fields in my form, one for username and the other for password. i want the password text box to hide input when user types in it.
Can someone please tell how can i do that in java, at the moment my form takes both input as simple text fields.

regards,
nemo

Recommended Answers

All 5 Replies

wow, thanks. got the code, Simple!

Hi, i am a beginner in java. i have to put two text fields in my form, one for username and the other for password. i want the password text box to hide input when user types in it.
Can someone please tell how can i do that in java, at the moment my form takes both input as simple text fields.

regards,
nemo

instead of jtextfield you must use jpasswordfield...
then use all methods just as a jtextfield ..


simple...

commented: Not helpful, bad explanation -1

use the swing JPasswordField , which is a class in Swing Library.
Also please get hold of the downloadable library API DOCs from the sun java site, that would be a great help
enjoy

kindly, you can use JPasswordField(javax.swing.JPasswordField)
:cool:

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.