开发者

Use an input formatter and password characteristic together with swing

I'm trying to make a Password field with Swing, but apply as well a format. I mea开发者_开发知识库n, i want the password field to be treated as a formatted field (following a specified format like 6 numbers separated with - each two) but instead of show the input, behaves like password field and show just * for each letter. Is that possible?

Thanks in advance, Cheers


This would not be too terribly hard to do. You would add a TextListener to your JPasswordField. The TextListener would be notified of changes to the password text, and you'd have the chance to reject the changes (i.e., change it back.)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜