In my Swing application, the user must insert numbers and values, before switching to the next window. Now as a clean program should, I check every input if its valid or not
You can get real time validation through the use a DocumentFilter
You check out this and this for some examples.
I do think, however, you might find the JFormattedTextField are more suitable solution in this case.
JFormattedTextField