Unfortunately, I saw the class and thought what a great idea! I think I'll end up rolling my own during the next iteration of this app.
I currently have a field with a phone number formatter and when I try to setText("")
or setText(" ")
to clear it out (as done when it was an instanceof JTextField), I get "invalidEdit()". If I override setText()
to check for these and then call setValue(null)
, I get a stack overflow for obvious reasons.
The problem is that the formatter doesn't like " ". I just want to clear the fricken value for chrissake! There is no reset()
, clear()
, empty()
or kabosh()
method. Before I end up with SwingUtilities.invokeLater(new Runnable(){public void run(){setValue(null);}});
I'll check the MaskFormatter doc.
No dice - even though the doc says an invalid value will set text to empty, it doesn't actually do that. jeezis, this has been so much more trouble than it's worth!
Something I find typical in Java: this overblown pseudo-OO ends up making the simple things HARD instead of making the hard things simple. Whoever worked on this probably also invented IOC...
GARRRGGGHHHHHHHH!!