Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to setEchoChar use in JTextField  RSS feed

 
Sanju
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi..
is there any body have idea abt ..this thing How to setEchoChar for JTextField.we can set the TextField for set TextField.setEchoChar('*') like that.How can we set for JTextField.
 
Shashi Kanta
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bindu,
JTextField doesn't have a similar method like setEchoChar().
But javax.swing provides a component JPasswordField for passwords field.
The default character displayed for whatever you type is '*'. If you want to change that, you can use setEchoChar(char c) method.
So, use JPasswordField for password fields.
Shashi
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!