Java Swing Font Size resetUIFont(String name, int style, int size)

Here you can find the source of resetUIFont(String name, int style, int size)

Description

UIFonts reset

License

Apache License

Parameter

Parameter Description
name a parameter
style a parameter
size a parameter

Declaration

public final static void resetUIFont(String name, int style, int size) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.Map;
import javax.swing.UIManager;
import javax.swing.plaf.FontUIResource;

public class Main {
    /**//from   w w  w. ja v  a  2s.co m
     * UIFonts reset
     *
     * @param name
     * @param style
     * @param size
     */
    public final static void resetUIFont(String name, int style, int size) {

        for (Map.Entry<Object, Object> entry : UIManager.getDefaults().entrySet()) {
            Object key = entry.getKey();
            Object value = UIManager.get(key);
            if (value != null && value instanceof FontUIResource) {
                FontUIResource f = new FontUIResource(name, style, size);
                UIManager.put(key, f);
            }
        }

    }
}

Related

  1. getFontSizeFactor()
  2. getSizeOfTextInComponent(String text, Font font, JComponent component)
  3. increaseFontSize(JComponent component, int offset)
  4. printDocumentMonospaced(Graphics g, Document doc, int fontSize, int pageIndex, PageFormat pageFormat, int tabSize)
  5. printDocumentMonospacedWordWrap(Graphics g, Document doc, int fontSize, int pageIndex, PageFormat pageFormat, int tabSize)
  6. resetUIFontSize(int size)
  7. ScaleLabelFontsizeAndDimension(JLabel label, int fontSize)
  8. setFontSize(JLabel label, int i)
  9. setFontSizeForComponent(JComponent component, int newFontSize)