Java Swing Font Set setUIFont(FontUIResource f)

Here you can find the source of setUIFont(FontUIResource f)

Description

set UI Font

License

LGPL

Declaration

public static void setUIFont(FontUIResource f) 

Method Source Code

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

import java.util.Enumeration;

import javax.swing.UIManager;
import javax.swing.plaf.FontUIResource;

public class Main {
    public static void setUIFont(FontUIResource f) {
        ///*from   w  w  w .  j  a v  a 2 s. c  om*/
        // sets the default FONT for all Swing components.
        // ex.
        // setUIFont (new javax.swing.plaf.FontUIResource
        // ("Serif",Font.ITALIC,12));
        //
        Enumeration<Object> keys = UIManager.getDefaults().keys();
        while (keys.hasMoreElements()) {
            Object key = keys.nextElement();
            Object value = UIManager.get(key);
            if (value instanceof FontUIResource)
                UIManager.put(key, f);
        }
    }
}

Related

  1. setUIFont(Font fon)
  2. setUIFont(FontUIResource f)
  3. setUIFont(FontUIResource f)
  4. setUIFont(FontUIResource f)
  5. setUIFont(FontUIResource f)
  6. setUIFont(javax.swing.plaf.FontUIResource f)
  7. setUIFont(javax.swing.plaf.FontUIResource f)
  8. setUIFont(javax.swing.plaf.FontUIResource f)
  9. setUIFont(javax.swing.plaf.FontUIResource f)