How to create UPPERCASE formatted text field with mixed character input
I am looking for a way to instantly format text that user types to uppercase. However the input will contain non-alphabet characters such as spaces and dashes. I tried JFormattedTextField with a long "UUUUUUUUUUUUUUUU" mask, but it is not able to handle non-alphabet characters.
For example format "bp96-00826a" into "BP96-00826A".
Is there a better or an easier way to do this than a document listener?
Document listener seems a bit of an overkill to do something so conceptually simple.
Thanks in advance.