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.
精彩评论