You might be wondering how you can change the way your GUI looks, for a given Look and Feel. You might be possibly taking a tutorial such as this one. This is how you can show what ui defaults are in force on your system. The source code is HERE.

 

import java.util.Enumeration;

import javax.swing.UIDefaults;
import javax.swing.UIManager;


public class UIDefs {
    public static void listAll() {
        try {
            UIManager.LookAndFeelInfo[] looks = UIManager.getInstalledLookAndFeels();

            for (UIManager.LookAndFeelInfo info : looks) {
                UIManager.setLookAndFeel(info.getClassName());

                UIDefaults defaults = UIManager.getDefaults();
                Enumeration newKeys = defaults.keys();

                while (newKeys.hasMoreElements()) {
                    Object obj = newKeys.nextElement();
                    System.out.printf("%50s (key type = %s): %s\n", obj,
                        obj.getClass(), UIManager.get(obj));
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public static void list() {
        UIDefaults defaults = UIManager.getDefaults();
        Enumeration newKeys = defaults.keys();

        while (newKeys.hasMoreElements()) {
            Object obj = newKeys.nextElement();
            System.out.printf("%50s (key type = %s): %s\n", obj,
                obj.getClass(), UIManager.get(obj));
        }
    }

    public static void main(String[] args) {
        UIDefs.listAll();
    }
}

 

Please support this site using the button below: