Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在此处输入图像描述
我想要一个注册表单,其中用户名或密码的标签部分将位于文本字段和密码字段中,但在密码字段中它将被隐藏。谁能帮我?..在Netbeans,Winform ex:表单登录facebook。我想要相同的用户名和密码
使用 JPasswordField 函数 jPasswordField.getPassword();
获取密码为 char[] 。
使用 jPasswordField1.setEchoChar('*') 用 * 屏蔽密码字符。
如果您希望查看要插入的值,请使用
jPasswordField1.setEchoChar((char)0);
将值设置为 0 表示您希望看到键入的文本,类似于标准 JTextField 的行为。