Java Swing Font Set setUIFont(javax.swing.plaf.FontUIResource f)

Here you can find the source of setUIFont(javax.swing.plaf.FontUIResource f)

Description

sets the default font for all Swing components.

License

Open Source License

Parameter

Parameter Description
f a parameter

Declaration

@SuppressWarnings("unchecked")
public static void setUIFont(javax.swing.plaf.FontUIResource f) 

Method Source Code

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

import javax.swing.UIManager;

public class Main {

    @SuppressWarnings("unchecked")
    public static void setUIFont(javax.swing.plaf.FontUIResource f) {
        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) {
                UIManager.put(key, f);
            }/*from  ww w .  j  ava 2 s  . c  o m*/
        }
    }
}

Related

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