开发者

How to restrict JTextField not taking more than 'x' numbers of inputs

I have a开发者_如何学Python JTextField. That takes in strings. For one JTextField, I want to limit to only two strings. For example 'fa' or '56' or '..' Not more than two.

Is there a way to do this?


You can use a Formatted Text Field.

Or you can create a custom Document Filter.

Creating a custom Document is an old approach that is generally not used anymore.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜