This post won't be about OpenGL, it will be about JavaFX. I'm currently writing a tool in JavaFX and wanted to give the user visual feedback about the validity of fields (mainly TextFields). I came across this post but while it achieves what I had in mind, it is pretty verbose and you would have to define everything over again for multiple fields.
I wanted to do a more generic version of what I had read and this is how it is used:
Valid Textfield
Textfield with warning
Textfield with error