In the process of updating some old programs, I had to change the GUI frameworks used. The old programs were written in Java using the Swing GUI framework and the JGoodies Forms and Looks libraries. Nowadays, the official GUI framework for Java is JavaFX.
Making the transition from Swing to JavaFX was relatively painless because the programs were so small. However, one of the things I missed from the JGoodies Forms library was the “titled separator”, that is a separator with a label in front of it. I really liked the look. Turns out that making my own wasn’t that difficult. Here’s a program extract that implements my version. (This time it’s written in Clojure.)
Instead of the standard black separator, this one is a nice grayish-blue. It coordinates with lots of the color schemes I use but is easy to change. Using it is pretty easy too. Just do something like:
and back comes a separator with a textual title in front of the rule line. If you call the function without a title, it will just return a nicely colored separator. The label will be in a bold version of the font normally used by the program and will be separated from the rule line by a few pixels. You can see what they look like in this screen shot of the sign test program that I udpated recently.