Java Swing Font Size setUIFontSize(float size)

Here you can find the source of setUIFontSize(float size)

Description

set UI Font Size

License

Open Source License

Declaration

public static void setUIFontSize(float size) 

Method Source Code

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

import java.awt.Font;

import javax.swing.UIManager;

public class Main {
    public static void setUIFontSize(float size) {
        java.util.Enumeration keys = UIManager.getDefaults().keys();
        while (keys.hasMoreElements()) {
            Object key = keys.nextElement();
            Object value = UIManager.get(key);
            if (value instanceof javax.swing.plaf.FontUIResource) {
                Font font = UIManager.getFont(key);
                if (font != null) {
                    UIManager.put(key, new javax.swing.plaf.FontUIResource(
                            font.deriveFont(size)));
                }//ww w. jav a 2  s. co  m
            }
        }
    }
}

Related

  1. resetUIFontSize(int size)
  2. ScaleLabelFontsizeAndDimension(JLabel label, int fontSize)
  3. setFontSize(JLabel label, int i)
  4. setFontSizeForComponent(JComponent component, int newFontSize)
  5. setLookAndFeel(int fontSize)
  6. setUIManagerFont(int fontSize)
  7. setUIManagerFont(int fontSize)