If you want to use other fonts or colors you may use UI-themes. Such a theme
defines a default font, a default foreground and a default background color.
Additionally, fonts/colors can be set for single component types.
A UI-theme can be defined in a simple property file:
# myThemeUI.properties
name=MyTheme
font=Arial-0-11
background=[245,245,250]
foreground=darkGray
TextField.background=white
TextArea.background=white
TextField.foreground=black
TextArea.foreground=black
ProgressBar.foreground=[153,153,255]
ToolTip.background=[234,234,255]
List.background=white
Now, the UI-theme can be applied. This must be done as soon as possible and
before any components is initialized.
try {
// Call this method before any component is initialized.
SwingUtils.applyUITheme(
getClass().getResource("/myThemeUI.properties"));
} catch (IOException ioe) {
ioe.printStackTrace();
}