In this question Is there any way to accept only numeric values in a JTextField? one of the answers suggested that JFormattedTextField had issues.
I've not yet used it, but could somebody please expand (or disagree) on the issues with this class?
JFormattedTextField
is evil because of poor usability. For instance, if a text field should only be able to accept an integer value, JFormattedTextField
will allow any old rubbish and then complain when focus is lost. To make matters worse, it has a range of configurable behaviours when focus is lost (a clear sign that none of them is the correct choice).
It also has "k3wl" formatter selection. It also seems to have poor interaction with the document (it tries to install a DocumentFilter
, but that is not part of the Document
interface).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With