• Post Reply Bookmark Topic Watch Topic
  • New Topic

Masking a text field  RSS feed

 
Suneel Setlur
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do you mask a text field so that ** are shown?
Example a password field.
Suneel
 
Paul Stevens
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want a password field, use JPassWordField
 
Sajee Joseph
Ranch Hand
Posts: 200
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
If u insist in using a Text field then u can use
TextField tf = new TextField();
tf.setEchoChar('*');
here u can set the echo character(maybe *, or any char)
But note that this works only for TextField and not JTextField. So if u wanna use juz the awt classes, use TextField .
If u wanna use swing calles, use JPasswordField
Regards
saj
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!