开发者

Native password mask symbol in Java

开发者 https://www.devze.com 2023-04-03 22:45 出处:网络
Ho to get system native password mask symbol in Java? It can be star in old Windows, big 开发者_Go百科circle in new Windows, some other symbol in Linux and mac.

Ho to get system native password mask symbol in Java? It can be star in old Windows, big 开发者_Go百科circle in new Windows, some other symbol in Linux and mac.

Update: swing solution is required


In AWT:

  TextField password = new TextField(8);
  password.getEchoChar();

In Swing:

 JPasswordField jpf = new JPasswordField();
 jpf.getEchoChar();

In the console, it is a bit tricky to set (check http://java.sun.com/developer/technicalArticles/Security/pwordmask/). To get, maybe playing with Console.writer().

Anyway, why on earth would you want to get that echo char?

0

精彩评论

暂无评论...
验证码 换一张
取 消