Here you can find the source of setWholeFont(Font f)
public static void setWholeFont(Font f)
//package com.java2s; /*/*from ww w . j av a2s . co m*/ * Copyright (c) 2008, AIST, the University of Tokyo and General Robotix Inc. * All rights reserved. This program is made available under the terms of the * Eclipse Public License v1.0 which accompanies this distribution, and is * available at http://www.eclipse.org/legal/epl-v10.html * Contributors: * General Robotix Inc. * National Institute of Advanced Industrial Science and Technology (AIST) */ 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 setWholeFont(Font f) { FontUIResource fontUIResource = new FontUIResource(f); UIDefaults defaultTable = UIManager.getLookAndFeelDefaults(); Set<Object> set = defaultTable.keySet(); Iterator<Object> it = set.iterator(); while (it.hasNext()) { Object o = it.next(); if (o instanceof String) { String s = (String) o; if (s.endsWith("font") || s.endsWith("Font")) UIManager.put(s, fontUIResource); } } } }