Class MultiLookAndFeel
public class MultiLookAndFeel extends LookAndFeel
A multiplexing look and feel that allows more than one UI to be associated with a component at the same time. The primary look and feel is called the default look and feel, and the other look and feels are called auxiliary.
For further information, see Using the Multiplexing Look and Feel.
Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeans has been added to the java.beans package. Please see XMLEncoder.
- See Also:
Constructor Summary
| Constructor | Description |
|---|---|
MultiLookAndFeel() |
Constructs a MultiLookAndFeel. |
Method Summary
| Modifier and Type | Method | Description |
|---|---|---|
static ComponentUI |
createUIs |
Creates the ComponentUI objects required to present the target component, placing the objects in the uis vector and returning the ComponentUI object that best represents the component's UI. |
UIDefaults |
getDefaults() |
Creates, initializes, and returns the look and feel specific defaults. |
String |
getDescription() |
Returns a one-line description of this look and feel. |
String |
getID() |
Returns a string, suitable for use by applications/services, that identifies this look and feel. |
String |
getName() |
Returns a string, suitable for use in menus, that identifies this look and feel. |
boolean |
isNativeLookAndFeel() |
Returns false; this look and feel is not native to any platform. |
boolean |
isSupportedLookAndFeel() |
Returns true; every platform permits this look and feel. |
protected static ComponentUI[] |
uisToArray |
Creates an array, populates it with UI objects from the passed-in vector, and returns the array. |
Methods declared in class LookAndFeel
getDesktopPropertyValue, getDisabledIcon, getDisabledSelectedIcon, getLayoutStyle, getSupportsWindowDecorations, initialize, installBorder, installColors, installColorsAndFont, installProperty, loadKeyBindings, makeComponentInputMap, makeIcon, makeInputMap, makeKeyBindings, provideErrorFeedback, toString, uninitialize, uninstallBorder | Modifier and Type | Method | Description |
|---|---|---|
static Object |
getDesktopPropertyValue |
Returns the value of the specified system desktop property by invoking Toolkit.getDefaultToolkit().getDesktopProperty(). |
Icon |
getDisabledIcon |
Returns an Icon with a disabled appearance. |
Icon |
getDisabledSelectedIcon |
Returns an Icon for use by disabled components that are also selected. |
LayoutStyle |
getLayoutStyle() |
Returns the LayoutStyle for this look and feel. |
boolean |
getSupportsWindowDecorations() |
Returns true if the LookAndFeel returned RootPaneUI instances support providing Window decorations in a JRootPane. |
void |
initialize() |
Initializes the look and feel. |
static void |
installBorder |
Convenience method for setting a component's border property with a value from the defaults. |
static void |
installColors |
Convenience method for setting a component's foreground and background color properties with values from the defaults. |
static void |
installColorsAndFont |
Convenience method for setting a component's foreground, background and font properties with values from the defaults. |
static void |
installProperty |
Convenience method for installing a property with the specified name and value on a component if that property has not already been set by the developer. |
static void |
loadKeyBindings |
Populates an InputMap with the specified bindings. |
static ComponentInputMap |
makeComponentInputMap |
Creates a ComponentInputMapUIResource from keys. |
static Object |
makeIcon |
Creates and returns a UIDefault.LazyValue that loads an image. |
static InputMap |
makeInputMap |
Creates an InputMapUIResource from keys. |
static JTextComponent.KeyBinding[] |
makeKeyBindings |
Convenience method for building an array of
KeyBindings. |
void |
provideErrorFeedback |
Invoked when the user attempts an invalid operation, such as pasting into an uneditable JTextField that has focus. |
String |
toString() |
Returns a string that displays and identifies this object's properties. |
void |
uninitialize() |
Uninitializes the look and feel. |
static void |
uninstallBorder |
Convenience method for uninstalling a border. |
Methods declared in class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait | Modifier and Type | Method | Description |
|---|---|---|
protected Object |
clone() |
Creates and returns a copy of this object. |
boolean |
equals |
Indicates whether some other object is "equal to" this one. |
protected void |
finalize() |
Deprecated, for removal: This API element is subject to removal in a future version. Finalization is deprecated and subject to removal in a future release. |
final Class |
getClass() |
Returns the runtime class of this Object. |
int |
hashCode() |
Returns a hash code value for this object. |
final void |
notify() |
Wakes up a single thread that is waiting on this object's monitor. |
final void |
notifyAll() |
Wakes up all threads that are waiting on this object's monitor. |
final void |
wait() |
Causes the current thread to wait until it is awakened, typically by being notified or interrupted. |
final void |
wait |
Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed. |
final void |
wait |
Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed. |
Constructor Details
MultiLookAndFeel
public MultiLookAndFeel()
MultiLookAndFeel.Method Details
getName
public String getName()
- Specified by:
-
getNamein classLookAndFeel - Returns:
- a string such as "Multiplexing Look and Feel"
getID
public String getID()
- Specified by:
-
getIDin classLookAndFeel - Returns:
- "Multiplex"
getDescription
public String getDescription()
- Specified by:
-
getDescriptionin classLookAndFeel - Returns:
- a descriptive string such as "Allows multiple UI instances per component instance"
isNativeLookAndFeel
public boolean isNativeLookAndFeel()
false; this look and feel is not native to any platform.- Specified by:
-
isNativeLookAndFeelin classLookAndFeel - Returns:
false
isSupportedLookAndFeel
public boolean isSupportedLookAndFeel()
true; every platform permits this look and feel.- Specified by:
-
isSupportedLookAndFeelin classLookAndFeel - Returns:
true- See Also:
getDefaults
public UIDefaults getDefaults()
ComponentUI class names (such as "javax.swing.plaf.multi.MultiButtonUI").- Overrides:
-
getDefaultsin classLookAndFeel - Returns:
- an initialized
UIDefaultsobject - See Also:
createUIs
public static ComponentUI createUIs(ComponentUI mui, Vector<ComponentUI> uis, JComponent target)
ComponentUI objects required to present the target component, placing the objects in the uis vector and returning the ComponentUI object that best represents the component's UI. This method finds the ComponentUI objects by invoking getDefaults().getUI(target) on each default and auxiliary look and feel currently in use. The first UI object this method adds to the uis vector is for the default look and feel. This method is invoked by the createUI method of MultiXxxxUI classes.
- Parameters:
-
mui- theComponentUIobject that represents the complete UI for thetargetcomponent; this should be an instance of one of theMultiXxxxUIclasses -
uis- aVector; generally this is theuisfield of themuiargument -
target- a component whose UI is represented bymui - Returns:
-
muiif the component has any auxiliary UI objects; otherwise, returns the UI object for the default look and feel ornullif the default UI object couldn't be found - See Also:
uisToArray
protected static ComponentUI[] uisToArray(Vector<? extends ComponentUI> uis)
uis is null, this method returns an array with zero elements. If uis is an empty vector, this method returns null. A run-time error occurs if any objects in the uis vector are not of type ComponentUI.- Parameters:
-
uis- a vector containingComponentUIobjects - Returns:
- an array equivalent to the passed-in vector
© 1993, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.