I'm working on a Look And Feel for java swing, my problem is creating a ComponentUI for components without a UIClassID.
For example, the javax.swing.Box component doesn't have a specific class id, but it does extend JComponent, which returns "ComponentUI" as its class id (JComponent#getUIClassID).
I've tried setting the UI in the UIDefaults, but the createUI method in my custom ComponentUI implementation isn't called.
defaults.put("ComponentUI", FancyComponentUI.class.getName());
Here is the FancyComponentUI class
public class FancyComponentUI extends ComponentUI {
public static ComponentUI createUI(JComponent c) {
System.out.println("Something is happening!");
return new FancyComponentUI();
}
}
All of the other custom UI's I've made are working absolutely fine, its just the ComponentUI implementation that is the problem.