Here you can find the source of changeDefaultFontSize(int fontSize)
Code from http://stackoverflow.com/questions/1236231/managing-swing-ui-default-font-sizes-without-quaqua
Parameter | Description |
---|---|
fontSize | a parameter |
public static void changeDefaultFontSize(int fontSize)
//package com.java2s; //License from project: Open Source License import java.util.Enumeration; import javax.swing.UIDefaults; import javax.swing.UIManager; import javax.swing.plaf.FontUIResource; public class Main { /**// w ww . j ava 2 s . com * Code from http://stackoverflow.com/questions/1236231/managing-swing-ui-default-font-sizes-without-quaqua * @param fontSize */ public static void changeDefaultFontSize(int fontSize) { UIDefaults defaults = UIManager.getDefaults(); // UIDefaults defaults = UIManager.getLookAndFeelDefaults(); Enumeration<Object> keys = defaults.keys(); while (keys.hasMoreElements()) { Object key = keys.nextElement(); if ((key instanceof String) && (((String) key).endsWith(".font"))) { FontUIResource font = (FontUIResource) UIManager.get(key); defaults.put(key, new FontUIResource(font.getFontName(), font.getStyle(), fontSize)); } } } }