简体   繁体   中英

java password field : dot code

Is there a code for the basic dot in password fields ? This one : dot

I have a button that shows the password (with setEchoChar()), but it's ugly if i put stars (*) when the user hide again the password.

Thanks.
(and btw first post, so if there is something I should change don't hesitate to say it)

Here is the most important part of the code :
if (getjCheckBox().isSelected()){ getjPasswordField().setEchoChar((char)0); } else { getjPasswordField().setEchoChar('*'); }

You can't look for an ASCII character because it's not an ASCII character but an unicode one. The one you are looking for should be this one.

Which can be set through field.setEchoChar('\•');

But the more reasonable choice would be to override the default one used by the current look and feel.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM