Here you can find the source of setUIDefaultFont()
public static final void setUIDefaultFont()
//package com.java2s; //License from project: Open Source License import java.awt.Font; import java.awt.GraphicsEnvironment; import java.util.Enumeration; import javax.swing.UIManager; import javax.swing.plaf.FontUIResource; public class Main { public static final void setUIDefaultFont() { Font defaultFont = null;//from w w w .j a v a 2 s. c om // Search font GraphicsEnvironment e = GraphicsEnvironment.getLocalGraphicsEnvironment(); Font[] fonts = e.getAllFonts(); // Get the fonts for (Font f : fonts) { if ("verdana".equals(f.getFontName().toLowerCase())) { defaultFont = f; break; } } if (defaultFont == null) { return; } Enumeration<Object> keys = UIManager.getDefaults().keys(); while (keys.hasMoreElements()) { Object key = keys.nextElement(); Object value = UIManager.get(key); if (value != null && value instanceof FontUIResource) { FontUIResource oldFUR = (FontUIResource) value; UIManager.put(key, new FontUIResource(defaultFont.getFontName(), oldFUR.getStyle(), oldFUR.getSize())); } } } }