List of usage examples for javax.swing UIDefaults getUI
public ComponentUI getUI(JComponent target)
ComponentUI
implementation for the specified component. From source file:net.sf.nmedit.jtheme.JTContext.java
public <T extends JTComponent> T createComponentInstance(Class<T> clazz) throws JTException { T component;/* www. j a v a 2 s .c om*/ try { component = clazz.getConstructor(new Class<?>[] { JTContext.class }).newInstance(new Object[] { this }); UIDefaults defaults = getUIDefaults(); if (hasUIClass(component, defaults)) { component.setUI(defaults.getUI(component)); } } catch (Throwable t) { JTException e = new JTException("could not create instance of " + clazz); e.initCause(t); throw e; } return component; }
From source file:net.sf.nmedit.jtheme.JTContext.java
private void installUI(JTModuleContainer moduleContainer) { UIDefaults defaults = getUIDefaults(); //if (hasUIClass(moduleContainer, defaults)) {/*from w w w . j a va2 s . co m*/ moduleContainer.setUI((JTModuleContainerUI) defaults.getUI(moduleContainer)); } }