Java Swing Font initGlobalFont(Font font)

Here you can find the source of initGlobalFont(Font font)

Description

init Global Font

License

Open Source License

Declaration

public static void initGlobalFont(Font font) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.awt.Font;
import java.util.Enumeration;
import javax.swing.UIManager;
import javax.swing.plaf.FontUIResource;

public class Main {
    public static void initGlobalFont(Font font) {
        FontUIResource fontRes = new FontUIResource(font);
        for (Enumeration<Object> keys = UIManager.getDefaults().keys(); keys.hasMoreElements();) {
            Object key = keys.nextElement();
            Object value = UIManager.get(key);
            if (value instanceof FontUIResource) {
                UIManager.put(key, fontRes);
            }//from  w  ww  .  ja v a2 s.c  o  m
        }
    }
}

Related

  1. getFont(String name)
  2. getFontColorToUse(boolean isSelected)
  3. getHelpTextArea(String help, Color background, Font font)
  4. getMultiLineTextForBBox(JComponent comp, double bboxWth, String txt, Font font)
  5. increaseDefaultFont(float multiplier)
  6. installColorsAndFont(Component c, Color background, Color foreground, Font font)
  7. installLargerDefaultFonts()
  8. listFonts()
  9. makeFontBold(JComponent c)