[Java] Setting the Window Title Font with the Substance Look and Feel

Fonts for various aspects of the UI is usually by putting the font as a default property in UIManager or UIDefaults. However, there doesn’t seem to be one for the window title. If you were using the Substance look and feel, SubstanceLookAndFeel provides the setFontPolicy(FontPolicy fontPolicy) method. By controlling FontPolicy, you will be able to control the font used for the window title.
Read more of this post

Advertisements

[Java] Getting Combo Box Renderers to Look Consistent with Other Combo Boxes

One way of controlling the text in a JComboBox is to provide a custom ListCellRenderer. I have seen implementations that subclass a concrete implementation (such as DefaultListCellRenderer or the BasicComboBoxRenderer). Generally though, I find that the combo boxes using such renderers can appear inconsistent with another combo box that may not have a renderer set or one that extends a different implementation. To illustrate the inconsistency that could happen, I prepared a small test program that you can download from my Github repository. It displays a number of combo boxes that are based on different renderers. Just running it produces the following dialog in Windows 7:

Read more of this post