Here you can find the source of setFont(Font font)
public static void setFont(Font font)
//package com.java2s; //License from project: Open Source License import javax.swing.*; import javax.swing.plaf.FontUIResource; import java.awt.*; import java.util.Enumeration; public class Main { public static void setFont(Font font) { FontUIResource fontRes = new FontUIResource(font); for (Enumeration<Object> keys = UIManager.getDefaults().keys(); keys.hasMoreElements();) { Object key = keys.nextElement(); Object value = UIManager.get(key); if (value instanceof FontUIResource) { UIManager.put(key, fontRes); }/*www. ja v a2 s .c om*/ } } }