Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enter a special character as a Password in the JTextField of the swing component?

When we enter password in any account the characters are not shown to us. I created a JTextField whose label is "password". What can I do so that when I enter characters in this JTextField they are shown like "***********" ?

like image 820
Neeraj singh Avatar asked Dec 19 '25 09:12

Neeraj singh


1 Answers

Don't use a normal JTextField, use a JPasswordField.

  • How to Use Password Fields
like image 133
Nate W. Avatar answered Dec 20 '25 23:12

Nate W.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!