Tanshaydar's Place
Currently nothing
Filed under: Programming

Java Swing Form Validation

Ever needed to verify your text fields and/or text areas that the input is in correct form?
Well, I did. As a matter of fact, where I work right now demanded me to provide verification for the project we were working for.
I searched for any reliable verification libraries for Java, and in fact I found a few, most popular being from JGoodies but due to requirements I ended up writing my own using the way provided here. Then again, that way was not enough, lacking in a few ways, making me improvise on it, and here it is.

For anyone interested, it’s on my GitHub account. I think code is very simple, and the Test class I provided gives a very clear idea as how to use it, or how to implement new validation ways. In any case, I will probably provide new examples and step by step implementation of a new verifier. All in all, I relied on the native method setInputVerifier( new myCustomInputVerifier()); so it is pretty convenient to use. Where I work will use this library (not as it is though) in our other project, so I guess it will be useful to some of you.

Verba Volant, Scripta Manent

This site uses Akismet to reduce spam. Learn how your comment data is processed.