Java tutorial
//package com.java2s; //License from project: LGPL import java.util.Enumeration; import javax.swing.UIManager; import javax.swing.plaf.FontUIResource; public class Main { public static void setUIFont(FontUIResource f) { // // sets the default FONT for all Swing components. // ex. // setUIFont (new javax.swing.plaf.FontUIResource // ("Serif",Font.ITALIC,12)); // Enumeration<Object> keys = UIManager.getDefaults().keys(); while (keys.hasMoreElements()) { Object key = keys.nextElement(); Object value = UIManager.get(key); if (value instanceof FontUIResource) UIManager.put(key, f); } } }