Java Netbeans 中具有密码属性的文本框

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2540943/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-13 09:04:01  来源:igfitidea点击:

Textbox with password properties in Netbeans

javanetbeanspasswordshide

提问by mouthpiec

In Netbeans, is it possible to hide the type password in a textbox with asterisk (******)?

在 Netbeans 中,是否可以在带有星号 ( ******)的文本框中隐藏类型密码?

Thanks

谢谢

采纳答案by Bozhidar Batsov

If you mean that you need to design a Swing UI with a password text field you should simply use the JPasswordField component form the standard Swing palette.

如果您的意思是需要设计带有密码文本字段的 Swing UI,您应该简单地使用标准 Swing 面板中的 JPasswordField 组件。

回答by Midhat

Use JPasswordField

使用 JPasswordField