javax.swing
public class UIManager extends Object implements Serializable
Nested Class Summary | |
---|---|
static class | UIManager.LookAndFeelInfo
Represents the basic information about a {@link LookAndFeel} (LAF), so
that a list of installed LAFs can be presented without actually loading
the LAF class(es). |
Constructor Summary | |
---|---|
UIManager()
Creates a new instance of the UIManager . |
Method Summary | |
---|---|
static void | addAuxiliaryLookAndFeel(LookAndFeel laf)
Add a {@link LookAndFeel} to the list of auxiliary look and feels.
|
static void | addPropertyChangeListener(PropertyChangeListener listener)
Add a PropertyChangeListener to the listener list.
|
static Object | get(Object key)
Returns an object from the {@link UIDefaults} table for the current
{@link LookAndFeel}.
|
static Object | get(Object key, Locale locale)
Returns an object from the {@link UIDefaults} table for the current
{@link LookAndFeel}.
|
static LookAndFeel[] | getAuxiliaryLookAndFeels()
Returns an array (possibly null ) containing the auxiliary
{@link LookAndFeel}s that are in use. |
static boolean | getBoolean(Object key)
Returns a boolean value from the defaults table. |
static boolean | getBoolean(Object key, Locale locale)
Returns a boolean value from the defaults table. |
static Border | getBorder(Object key)
Returns a border from the defaults table.
|
static Border | getBorder(Object key, Locale locale)
Returns a border from the defaults table.
|
static Color | getColor(Object key)
Returns a drawing color from the defaults table.
|
static Color | getColor(Object key, Locale locale)
Returns a drawing color from the defaults table.
|
static String | getCrossPlatformLookAndFeelClassName()
The fully qualified class name of the cross platform (Metal) look and feel.
|
static UIDefaults | getDefaults()
Returns the default values for this look and feel.
|
static Dimension | getDimension(Object key)
Returns a dimension from the defaults table.
|
static Dimension | getDimension(Object key, Locale locale)
Returns a dimension from the defaults table.
|
static Font | getFont(Object key)
Retrieves a font from the defaults table of the current
LookAndFeel.
|
static Font | getFont(Object key, Locale locale)
Retrieves a font from the defaults table of the current
LookAndFeel.
|
static Icon | getIcon(Object key)
Returns an icon from the defaults table.
|
static Icon | getIcon(Object key, Locale locale)
Returns an icon from the defaults table.
|
static Insets | getInsets(Object key)
Returns an Insets object from the defaults table.
|
static Insets | getInsets(Object key, Locale locale)
Returns an Insets object from the defaults table.
|
static UIManager.LookAndFeelInfo[] | getInstalledLookAndFeels()
Returns an array containing information about the {@link LookAndFeel}s
that are installed.
|
static int | getInt(Object key)
Returns the integer value of the {@link Integer} associated with the
given key. |
static int | getInt(Object key, Locale locale)
Returns the integer value of the {@link Integer} associated with the
given key. |
static LookAndFeel | getLookAndFeel()
Returns the current look and feel (which may be null ).
|
static UIDefaults | getLookAndFeelDefaults()
Returns the UIDefaults table of the currently active
look and feel.
|
static PropertyChangeListener[] | getPropertyChangeListeners()
Returns an array of all added PropertyChangeListener objects.
|
static String | getString(Object key)
Returns the {@link String} associated with the given key. |
static String | getString(Object key, Locale locale)
Returns the {@link String} associated with the given key. |
static String | getSystemLookAndFeelClassName()
Returns the name of the {@link LookAndFeel} class that implements the
native systems look and feel if there is one, otherwise the name
of the default cross platform LookAndFeel class.
|
static ComponentUI | getUI(JComponent target)
Returns UI delegate from the current {@link LookAndFeel} that renders the
target component.
|
static void | installLookAndFeel(String name, String className)
Creates a new look and feel and adds it to the current array.
|
static void | installLookAndFeel(UIManager.LookAndFeelInfo info)
Adds the specified look and feel to the current array and then calls
setInstalledLookAndFeels(javax.swing.UIManager.LookAndFeelInfo[]). |
static Object | put(Object key, Object value)
Stores an object in the defaults table.
|
static boolean | removeAuxiliaryLookAndFeel(LookAndFeel laf)
Removes a {@link LookAndFeel} (LAF) from the list of auxiliary LAFs.
|
static void | removePropertyChangeListener(PropertyChangeListener listener)
Remove a PropertyChangeListener from the listener list.
|
static void | setInstalledLookAndFeels(UIManager.LookAndFeelInfo[] infos)
Replaces the current array of installed LookAndFeelInfos. |
static void | setLookAndFeel(LookAndFeel newLookAndFeel)
Sets the current {@link LookAndFeel}.
|
static void | setLookAndFeel(String className)
Set the current default look and feel using a class name.
|
UIManager
. There is no need
to construct an instance of this class, since all methods are static.Parameters: laf the auxiliary look and feel (null
not permitted).
Throws: NullPointerException if laf
is null
.
See Also: getAuxiliaryLookAndFeels
PropertyChangeListener
to the listener list.
Parameters: listener the listener to add
Parameters: key the key.
Returns: The object.
Parameters: key the key.
Returns: The object.
Since: 1.4
null
) containing the auxiliary
{@link LookAndFeel}s that are in use. These are used by the
{@link javax.swing.plaf.multi.MultiLookAndFeel} class.
Returns: The auxiliary look and feels (possibly null
).
See Also: addAuxiliaryLookAndFeel
false
.
Parameters: key the key (null
not permitted).
Returns: The boolean value associated with the specified key.
Throws: NullPointerException if key
is null
.
Since: 1.4
false
.
Parameters: key the key (null
not permitted). locale the locale.
Returns: The boolean value associated with the specified key.
Throws: NullPointerException if key
is null
.
Since: 1.4
Parameters: key the key (null
not permitted).
Returns: The border associated with the given key, or null
.
Throws: NullPointerException if key
is null
.
Parameters: key the key (null
not permitted). locale the locale.
Returns: The border associated with the given key, or null
.
Throws: NullPointerException if key
is null
.
Since: 1.4
Parameters: key the key (null
not permitted).
Returns: The color associated with the given key, or null
.
Throws: NullPointerException if key
is null
.
Parameters: key the key (null
not permitted). locale the locale.
Returns: The color associated with the given key, or null
.
Throws: NullPointerException if key
is null
.
Since: 1.4
Returns: "javax.swing.plaf.metal.MetalLookAndFeel"
Returns: The {@link UIDefaults} for the current {@link LookAndFeel}.
Parameters: key the key (null
not permitted).
Returns: The color associated with the given key, or null
.
Throws: NullPointerException if key
is null
.
Parameters: key the key (null
not permitted). locale the locale.
Returns: The color associated with the given key, or null
.
Throws: NullPointerException if key
is null
.
Since: 1.4
Parameters: key an Object that specifies the font. Typically,
this is a String such as
TitledBorder.font
.
Returns: The font associated with the given key, or null
.
Throws: NullPointerException if key
is null
.
Parameters: key an Object that specifies the font. Typically,
this is a String such as
TitledBorder.font
. locale the locale.
Returns: The font associated with the given key, or null
.
Throws: NullPointerException if key
is null
.
Since: 1.4
Parameters: key the key (null
not permitted).
Returns: The icon associated with the given key, or null
.
Throws: NullPointerException if key
is null
.
Parameters: key the key (null
not permitted). locale the locale.
Returns: The icon associated with the given key, or null
.
Throws: NullPointerException if key
is null
.
Since: 1.4
Parameters: key the key (null
not permitted).
Returns: The insets associated with the given key, or null
.
Throws: NullPointerException if key
is null
.
Parameters: key the key (null
not permitted). locale the locale.
Returns: The insets associated with the given key, or null
.
Throws: NullPointerException if key
is null
.
Since: 1.4
Returns: A list of the look and feels that are available (installed).
Parameters: key the key (null
not permitted).
Returns: The integer value associated with the given key, or 0.
Parameters: key the key (null
not permitted). locale the locale.
Returns: The integer value associated with the given key, or 0.
Since: 1.4
null
).
Returns: The current look and feel.
See Also: setLookAndFeel
UIDefaults
table of the currently active
look and feel.
Returns: The {@link UIDefaults} for the current {@link LookAndFeel}.
PropertyChangeListener
objects.
Returns: an array of listeners
Since: 1.4
null
.
Parameters: key the key (null
not permitted).
Returns: The string associated with the given key, or null
.
null
.
Parameters: key the key (null
not permitted). locale the locale.
Returns: The string associated with the given key, or null
.
Since: 1.4
Returns: The fully qualified class name for the system look and feel.
See Also: getCrossPlatformLookAndFeelClassName
Parameters: target the target component.
Parameters: name the look and feel name. className the fully qualified name of the class that implements the look and feel.
Parameters: key the key. value the value.
Parameters: laf the LAF to remove.
Returns: true
if the LAF was removed, and false
otherwise.
PropertyChangeListener
from the listener list.
Parameters: listener the listener to remove
Parameters: newLookAndFeel the new look and feel (null
permitted).
Throws: UnsupportedLookAndFeelException if the look and feel is not supported on the current platform.
See Also: isSupportedLookAndFeel
Parameters: className the look and feel class name.
Throws: UnsupportedLookAndFeelException if the look and feel is not supported on the current platform.
See Also: isSupportedLookAndFeel