
On the JComponent the ComponentUI is providing the These are documented in theĬlasses that require the specific default.Īll ComponentUIs typically need to set various properties Some of Swing's components require the look and feel To provide a set of defaults that are layered in with developer and Provided a value for a particular ui class id and an instance ofĪs noted in UIManager each LookAndFeel has the opportunity Random exceptions will occur if the current look and feel has not Not check that an entry exists for all ui class ids. When a LookAndFeel is installed the UIManager does

UIDefaults.getUI(JComponent) for details on how the implementation This is accomplished byīasicLookAndFeel providing the key-value pair For example,īasicLookAndFeel uses BasicTreeUI as the concrete

UIDefaults object returned from getDefaults. Specifying a value for each of Swing's ui class ids in the Subclass it requires by way of the JComponent methodĮach LookAndFeel implementation must provideĪn implementation of the appropriate ComponentUI subclass by JComponent subclass identifies the ComponentUI The implementation of the specificĬomponentUI subclass is provided by the LookAndFeel. For example, JTree requiresĪn implementation of the ComponentUI subclass Subclass is responsible for providing the look and feel specificįunctionality of the component. "component ui", or "look and feel delegate". The ComponentUI is often referred to as "the ui", Subclass has an implementation of a specific ComponentUI Swing is built upon the foundation that each JComponent

In general only developersĬreating a custom look and feel need to concern themselves with this class. Beyond installing a look and feel most developers never need to LookAndFeel, as the name implies, encapsulates a look andįeel.
