Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
javax.swing.UIManager
LookAndFeel
and any auxiliary LookAndFeel
instances.
Nested Class Summary | |
static class |
|
Constructor Summary | |
|
Method Summary | |
static void |
|
static void |
|
static Object |
|
static Object |
|
static LookAndFeel[] |
|
static boolean |
|
static boolean |
|
static Border | |
static Border | |
static Color | |
static Color | |
static String |
|
static UIDefaults |
|
static Dimension |
|
static Dimension |
|
static Font | |
static Font | |
static Icon | |
static Icon | |
static Insets | |
static Insets | |
static UIManager.LookAndFeelInfo[] |
|
static int | |
static int | |
static LookAndFeel |
|
static UIDefaults |
|
static PropertyChangeListener[] |
|
static String | |
static String | |
static String |
|
static ComponentUI |
|
static void |
|
static void |
|
static Object | |
static boolean |
|
static void |
|
static void |
|
static void |
|
static void |
|
Methods inherited from class java.lang.Object | |
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
public static void addAuxiliaryLookAndFeel(LookAndFeel laf)
Add aLookAndFeel
to the list of auxiliary look and feels.
- Parameters:
laf
- the auxiliary look and feel (null
not permitted).
- Throws:
NullPointerException
- iflaf
isnull
.
- See Also:
getAuxiliaryLookAndFeels()
public static void addPropertyChangeListener(PropertyChangeListener listener)
Add aPropertyChangeListener
to the listener list.
- Parameters:
listener
- the listener to add
public static Object get(Object key)
Returns an object from theUIDefaults
table for the currentLookAndFeel
.
- Parameters:
key
- the key.
- Returns:
- The object.
public static Object get(Object key, Locale locale)
Returns an object from theUIDefaults
table for the currentLookAndFeel
.
- Parameters:
key
- the key.
- Returns:
- The object.
- Since:
- 1.4
public static LookAndFeel[] getAuxiliaryLookAndFeels()
Returns an array (possiblynull
) containing the auxiliaryLookAndFeel
s that are in use. These are used by theMultiLookAndFeel
class.
- Returns:
- The auxiliary look and feels (possibly
null
).
- See Also:
addAuxiliaryLookAndFeel(LookAndFeel)
public static boolean getBoolean(Object key)
Returns a boolean value from the defaults table. If there is no value for the specified key, or the value is not an instance ofBoolean
, this method returnsfalse
.
- Parameters:
key
- the key (null
not permitted).
- Returns:
- The boolean value associated with the specified key.
- Throws:
NullPointerException
- ifkey
isnull
.
- Since:
- 1.4
public static boolean getBoolean(Object key, Locale locale)
Returns a boolean value from the defaults table. If there is no value for the specified key, or the value is not an instance ofBoolean
, this method returnsfalse
.
- Parameters:
key
- the key (null
not permitted).locale
- the locale.
- Returns:
- The boolean value associated with the specified key.
- Throws:
NullPointerException
- ifkey
isnull
.
- Since:
- 1.4
public static Border getBorder(Object key)
Returns a border from the defaults table.
- Parameters:
key
- the key (null
not permitted).
- Returns:
- The border associated with the given key, or
null
.
- Throws:
NullPointerException
- ifkey
isnull
.
public static Border getBorder(Object key, Locale locale)
Returns a border from the defaults table.
- Parameters:
key
- the key (null
not permitted).locale
- the locale.
- Returns:
- The border associated with the given key, or
null
.
- Throws:
NullPointerException
- ifkey
isnull
.
- Since:
- 1.4
public static Color getColor(Object key)
Returns a drawing color from the defaults table.
- Parameters:
key
- the key (null
not permitted).
- Returns:
- The color associated with the given key, or
null
.
- Throws:
NullPointerException
- ifkey
isnull
.
public static Color getColor(Object key, Locale locale)
Returns a drawing color from the defaults table.
- Parameters:
key
- the key (null
not permitted).locale
- the locale.
- Returns:
- The color associated with the given key, or
null
.
- Throws:
NullPointerException
- ifkey
isnull
.
- Since:
- 1.4
public static String getCrossPlatformLookAndFeelClassName()
The fully qualified class name of the cross platform (Metal) look and feel. This string can be passed to Class.forName()
- Returns:
"javax.swing.plaf.metal.MetalLookAndFeel"
public static UIDefaults getDefaults()
Returns the default values for this look and feel.
- Returns:
- The
UIDefaults
for the currentLookAndFeel
.
public static Dimension getDimension(Object key)
Returns a dimension from the defaults table.
- Parameters:
key
- the key (null
not permitted).
- Returns:
- The color associated with the given key, or
null
.
- Throws:
NullPointerException
- ifkey
isnull
.
public static Dimension getDimension(Object key, Locale locale)
Returns a dimension from the defaults table.
- Parameters:
key
- the key (null
not permitted).locale
- the locale.
- Returns:
- The color associated with the given key, or
null
.
- Throws:
NullPointerException
- ifkey
isnull
.
- Since:
- 1.4
public static Font getFont(Object key)
Retrieves a font from the defaults table of the current LookAndFeel.
- Parameters:
key
- an Object that specifies the font. Typically, this is a String such asTitledBorder.font
.
- Returns:
- The font associated with the given key, or
null
.
- Throws:
NullPointerException
- ifkey
isnull
.
public static Font getFont(Object key, Locale locale)
Retrieves a font from the defaults table of the current LookAndFeel.
- Parameters:
key
- an Object that specifies the font. Typically, this is a String such asTitledBorder.font
.locale
- the locale.
- Returns:
- The font associated with the given key, or
null
.
- Throws:
NullPointerException
- ifkey
isnull
.
- Since:
- 1.4
public static Icon getIcon(Object key)
Returns an icon from the defaults table.
- Parameters:
key
- the key (null
not permitted).
- Returns:
- The icon associated with the given key, or
null
.
- Throws:
NullPointerException
- ifkey
isnull
.
public static Icon getIcon(Object key, Locale locale)
Returns an icon from the defaults table.
- Parameters:
key
- the key (null
not permitted).locale
- the locale.
- Returns:
- The icon associated with the given key, or
null
.
- Throws:
NullPointerException
- ifkey
isnull
.
- Since:
- 1.4
public static Insets getInsets(Object key)
Returns an Insets object from the defaults table.
- Parameters:
key
- the key (null
not permitted).
- Returns:
- The insets associated with the given key, or
null
.
- Throws:
NullPointerException
- ifkey
isnull
.
public static Insets getInsets(Object key, Locale locale)
Returns an Insets object from the defaults table.
- Parameters:
key
- the key (null
not permitted).locale
- the locale.
- Returns:
- The insets associated with the given key, or
null
.
- Throws:
NullPointerException
- ifkey
isnull
.
- Since:
- 1.4
public static UIManager.LookAndFeelInfo[] getInstalledLookAndFeels()
Returns an array containing information about theLookAndFeel
s that are installed.
- Returns:
- A list of the look and feels that are available (installed).
public static int getInt(Object key)
Returns the integer value of theInteger
associated with the given key. If there is no value, or the value is not an instance ofInteger
, this method returns 0.
- Parameters:
key
- the key (null
not permitted).
- Returns:
- The integer value associated with the given key, or 0.
public static int getInt(Object key, Locale locale)
Returns the integer value of theInteger
associated with the given key. If there is no value, or the value is not an instance ofInteger
, this method returns 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
public static LookAndFeel getLookAndFeel()
Returns the current look and feel (which may benull
).
- Returns:
- The current look and feel.
- See Also:
setLookAndFeel(LookAndFeel)
public static UIDefaults getLookAndFeelDefaults()
Returns theUIDefaults
table of the currently active look and feel.
- Returns:
- The
UIDefaults
for the currentLookAndFeel
.
public static PropertyChangeListener[] getPropertyChangeListeners()
Returns an array of all addedPropertyChangeListener
objects.
- Returns:
- an array of listeners
- Since:
- 1.4
public static String getString(Object key)
Returns theString
associated with the given key. If the value is not aString
, this method returnsnull
.
- Parameters:
key
- the key (null
not permitted).
- Returns:
- The string associated with the given key, or
null
.
public static String getString(Object key, Locale locale)
Returns theString
associated with the given key. If the value is not aString
, this method returnsnull
.
- Parameters:
key
- the key (null
not permitted).locale
- the locale.
- Returns:
- The string associated with the given key, or
null
.
- Since:
- 1.4
public static String getSystemLookAndFeelClassName()
Returns the name of theLookAndFeel
class that implements the native systems look and feel if there is one, otherwise the name of the default cross platform LookAndFeel class.
- Returns:
- The fully qualified class name for the system look and feel.
public static ComponentUI getUI(JComponent target)
Returns UI delegate from the currentLookAndFeel
that renders the target component.
- Parameters:
target
- the target component.
public static void installLookAndFeel(String name, String className)
Creates a new look and feel and adds it to the current array.
- Parameters:
name
- the look and feel name.className
- the fully qualified name of the class that implements the look and feel.
public static void installLookAndFeel(UIManager.LookAndFeelInfo info)
Adds the specified look and feel to the current array and then calls setInstalledLookAndFeels(javax.swing.UIManager.LookAndFeelInfo[]).
public static Object put(Object key, Object value)
Stores an object in the defaults table.
- Parameters:
key
- the key.value
- the value.
public static boolean removeAuxiliaryLookAndFeel(LookAndFeel laf)
Removes aLookAndFeel
(LAF) from the list of auxiliary LAFs.
- Parameters:
laf
- the LAF to remove.
- Returns:
true
if the LAF was removed, andfalse
otherwise.
public static void removePropertyChangeListener(PropertyChangeListener listener)
Remove aPropertyChangeListener
from the listener list.
- Parameters:
listener
- the listener to remove
public static void setInstalledLookAndFeels(UIManager.LookAndFeelInfo[] infos)
Replaces the current array of installed LookAndFeelInfos.
public static void setLookAndFeel(String className) throws ClassNotFoundException, InstantiationException, IllegalAccessException, UnsupportedLookAndFeelException
Set the current default look and feel using a class name.
- Parameters:
className
- the look and feel class name.
- Throws:
UnsupportedLookAndFeelException
- if the look and feel is not supported on the current platform.
- See Also:
LookAndFeel.isSupportedLookAndFeel()
public static void setLookAndFeel(LookAndFeel newLookAndFeel) throws UnsupportedLookAndFeelException
Sets the currentLookAndFeel
.
- 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:
LookAndFeel.isSupportedLookAndFeel()