3

We are trying to get quaqua out of our application. We had been using a call to quaqua to set the font size to be smaller with a call like this:

System.setProperty("Quaqua.sizeStyle", "small");

Is there an easy to do the same sort of thing without using quaqua? Or does anyone know another good look and feel for OS X?

Jason Plank
  • 2,336
  • 5
  • 31
  • 40
Mike2012
  • 7,629
  • 15
  • 84
  • 135

1 Answers1

5

I also had an almost similar challenge, setting all font to a specific font. The code below will change the font size for all *.font properties in UIManager to a particular size

private static void setFontSize() {
    int fontSize = 12;
    Hashtable defaults = UIManager.getDefaults();
    Enumeration keys = defaults.keys();
    while (keys.hasMoreElements()) {
        Object key = keys.nextElement();

        if ((key instanceof String) && (((String) key).endsWith(".font"))) {
            FontUIResource font = (FontUIResource) UIManager.get(key);
            defaults.put (key, new FontUIResource(font.getFontName(), font.getStyle(), fontSize));
        }
    }
 }
koppor
  • 19,079
  • 15
  • 119
  • 161
n002213f
  • 7,805
  • 13
  • 69
  • 105
  • 1
    From a comment on answer http://stackoverflow.com/a/8120380/873282 : It easier to use deriveFont(): tree.setFont(tree.getFont().deriveFont(24f)); – koppor Dec 23 '12 at 13:41