Here you can find the source of setUIManagerFont(int fontSize)
public static void setUIManagerFont(int fontSize)
//package com.java2s; // modify it under the terms of the GNU General Public License import java.awt.Font; import java.util.Iterator; import java.util.Set; import javax.swing.UIDefaults; import javax.swing.UIManager; import javax.swing.plaf.FontUIResource; public class Main { public static void setUIManagerFont(int fontSize) { // Method Instances Object uiObject;/* w w w . ja v a2 s . co m*/ Font uiManagerFont; UIDefaults uiDefaults; // Setup uiObject = null; uiObject = UIManager.get("Label.font"); if (uiObject != null && uiObject instanceof Font) uiManagerFont = (Font) uiObject; else return; if (uiManagerFont.getSize() == fontSize) return; // Collect the UI Manager keys that are fonts // and update them to the new font size. uiDefaults = UIManager.getLookAndFeelDefaults(); Set<Object> hash = uiDefaults.keySet(); Iterator<Object> iterator = hash.iterator(); while (iterator.hasNext()) { Object curObj = iterator.next(); // System.out.println("MyJSQLView_Utils setUIManager() " + curObj.toString()); if (curObj.toString().indexOf("font") != -1) { // System.out.println("MyJSQLView_Utils setUIManager() " + curObj); UIManager.put(curObj, new FontUIResource(uiManagerFont.getFontName(), uiManagerFont.getStyle(), fontSize)); } } } }