Changing the default fonts via UIManager
Code:
public static void main(String[] args) {
try {
// Set System L&F
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (UnsupportedLookAndFeelException e) {
System.out.println("unsupported look and feel exception");
} catch (ClassNotFoundException e) {
System.out.println("Class not found");
} catch (InstantiationException e) {
System.out.println("instantiation exception");
} catch (IllegalAccessException e) {
System.out.println("illegal access exception");
}
Font defaultFont = new Font("Arial",Font.PLAIN,12);
UIManager.put("Label.font", defaultFont);
...
My system look and feel is gtk. The default font is hideous. I have changed it on my system so I never see it, but Java still uses it. As far as I can tell this should work (to change the JLabel's), but it doesn't seem to have any effect.