Example usage for javax.swing UIDefaults getUIClass

List of usage examples for javax.swing UIDefaults getUIClass

Introduction

In this page you can find the example usage for javax.swing UIDefaults getUIClass.

Prototype

public Class<? extends ComponentUI> getUIClass(String uiClassID, ClassLoader uiClassLoader) 

Source Link

Document

The value of get(uidClassID) must be the String name of a class that implements the corresponding ComponentUI class.

Usage

From source file:net.sf.nmedit.jtheme.JTContext.java

public static boolean hasUIClass(JComponent component, UIDefaults defaults) {
    String uiClassID = component.getUIClassID();
    if (uiClassID == null)
        return false;

    Object cl = defaults.get(UIDefaultsClassLoaderKey);
    ClassLoader uiClassLoader = (cl != null) ? (ClassLoader) cl : component.getClass().getClassLoader();

    Class uiClass = defaults.getUIClass(uiClassID, uiClassLoader);
    return uiClass != null;
}