Here you can find the source of setUIFont(Font fon)
Parameter | Description |
---|---|
fon | the new Font |
public static void setUIFont(Font fon)
//package com.java2s; //License from project: LGPL import javax.swing.*; import javax.swing.plaf.FontUIResource; import java.awt.*; import java.util.Enumeration; public class Main { /**//from www . j a v a 2 s . co m * Sets the default Font for the current UIManager * * @param fon the new Font */ public static void setUIFont(Font fon) { FontUIResource f = new FontUIResource(fon); Enumeration keys = UIManager.getDefaults().keys(); while (keys.hasMoreElements()) { Object key = keys.nextElement(); Object value = UIManager.get(key); if (value != null && value instanceof javax.swing.plaf.FontUIResource) { UIManager.put(key, f); } } for (Window w : Window.getWindows()) { SwingUtilities.updateComponentTreeUI(w); } } }