List of usage examples for javax.swing.plaf FontUIResource getFamily
public String getFamily()
From source file:edu.ku.brc.ui.UIRegistry.java
/** * Creates the initial font mapping from the base font size to the other sizes. * @param clazz the class of the component * @param baseFontArg the base font size *///from ww w . j av a 2 s .c o m protected static void adjustAllFonts(final Font oldBaseFont, final Font baseFontArg) { if (oldBaseFont != null && baseFontArg != null) { int fontSize = baseFontArg.getSize(); int oldFontSize = oldBaseFont.getSize(); String family = baseFontArg.getFamily(); UIDefaults uiDefaults = UIManager.getDefaults(); Enumeration<Object> e = uiDefaults.keys(); while (e.hasMoreElements()) { Object key = e.nextElement(); if (key.toString().endsWith(".font")) { FontUIResource fontUIRes = (FontUIResource) uiDefaults.get(key); if (fontSize != fontUIRes.getSize() || !family.equals(fontUIRes.getFamily())) { UIManager.put(key, new FontUIResource(new Font(family, fontUIRes.getStyle(), fontSize + (fontUIRes.getSize() - oldFontSize)))); } } } } }