TopBlend:
Here is the
first difference.
There are 119 differences.
is old.
is new.
javax.swing
Class UIManager
java.lang.Object
javax.swing.UIManager
-
All Implemented Interfaces:
-
Serializable
-
public class UIManager
- extends Object
- implements Serializable
UIManager manages the current look and feel, the set of available look and feels, PropertyChangeListeners that are notified when the look and feel changes, look and feel defaults, and convenience methods for obtaining various default values.
Specifying the look and feel
The look and feel can be specified in two distinct ways: by specifying the fully qualified name of the class for the look and feel, or by creating an instance of LookAndFeel and passing it to setLookAndFeel. The following example illustrates setting the look and feel to the system look and feel:
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
The following example illustrates setting the look and feel based on class name:
UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
Once the look and feel has been changed it is imperative to invoke updateUI on all JComponents. The method
SwingUtilities.updateComponentTreeUI(java.awt.Component)
makes it easy to apply updateUI to a containment hierarchy. Refer to it for details. The exact behavior of not invoking updateUI after changing the look and feel is unspecified. It is very possible to receive unexpected exceptions, painting problems, or worse.
Default look and feel
The class used for the default look and feel is chosen in the following manner:
This class keeps track of the current look and feel and its defaults. The default look and feel class is chosen in the following manner:
-
If the system property swing.defaultlaf is non-null, use
its value
it
as the default look and feel class name. -
If the
Properties
file swing.properties exists and contains the key swing.defaultlaf, use its value as
the
default look and feel class name. The location
that is checked for
of
swing.properties may vary depending upon the implementation of the Java platform. In Sun's implementation
the location is ${java.home}/lib/swing.properties.
this will reside in &java.home>/lib/swing.properties.
Refer to the release notes of the implementation
being used
you are using
for further details. -
Otherwise use the
cross platform
Java
look and feel.
Defaults
UIManager manages three sets of UIDefaults. In order, they are:
-
Developer defaults. With few exceptions Swing does not alter the developer defaults; these are intended to be modified and used by the developer.
-
Look and feel defaults. The look and feel defaults are supplied by the look and feel at the time it is installed as the current look and feel (setLookAndFeel() is invoked). The look and feel defaults can be obtained using the getLookAndFeelDefaults() method.
-
Sytem defaults. The system defaults are provided by Swing.
Invoking any of the various get methods results in checking each of the defaults, in order, returning the first non-null value. For example, invoking UIManager.getString("Table.foreground") results in first checking developer defaults. If the developer defaults contain a value for "Table.foreground" it is returned, otherwise the look and feel defaults are checked, followed by the system defaults.
It's important to note that getDefaults returns a custom instance of UIDefaults with this resolution logic built into it. For example, UIManager.getDefaults().getString("Table.foreground") is equivalent to UIManager.getString("Table.foreground"). Both resolve using the algorithm just described. In many places the documentation uses the word defaults to refer to the custom instance of UIDefaults with the resolution logic as previously described.
We manage three levels of defaults: user defaults, look and feel defaults, system defaults. A call to UIManager.get checks all three levels in order and returns the first non-null value for a key, if any. A call to UIManager.put just affects the user defaults. Note that a call to setLookAndFeel doesn't affect the user defaults, it just replaces the middle defaults "level".
When the look and feel is changed, UIManager alters only the look and feel defaults; the developer and system defaults are not altered by the UIManager in any way.
The set of defaults a particular look and feel supports is defined and documented by that look and feel. In addition, each look and feel, or ComponentUI provided by a look and feel, may access the defaults at different times in their life cycle. Some look and feels may agressively look up defaults, so that changing a default may not have an effect after installing the look and feel. Other look and feels may lazily access defaults so that a change to the defaults may effect an existing look and feel. Finally, other look and feels might not configure themselves from the defaults table in any way. None-the-less it is usually the case that a look and feel expects certain defaults, so that in general a ComponentUI provided by one look and feel will not work with another 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
TM
has been added to the java.beans package. Please see
XMLEncoder
.
-
See Also:
-
javax.swing.plaf.metal
Nested Class Summary
|
static class |
UIManager.LookAndFeelInfo
Provides a little information about an installed LookAndFeel for the sake of configuring a menu or for initial application set up. |
Method Summary
|
static void |
addAuxiliaryLookAndFeel
(
LookAndFeel
laf)
Adds a LookAndFeel to the list of auxiliary look and feels. |
static void |
addPropertyChangeListener
(
PropertyChangeListener
listener)
Adds a PropertyChangeListener to the listener list. |
static
Object
|
get
(
Object
Returns an object from the
defaults.
defaults table.
|
static
Object
|
get
(
Object
key,
Locale
Returns an object from the defaults
table
that is appropriate for the given locale. |
static
LookAndFeel
[] |
getAuxiliaryLookAndFeels
()
Returns the list of auxiliary look and feels (can be null). |
static boolean |
getBoolean
(
Object
Returns a boolean from the defaults
table
which is associated with the key value. |
static boolean |
getBoolean
(
Object
key,
Locale
Returns a boolean from the defaults
table
which is associated with the key value and the given Locale. |
static
Border
|
getBorder
(
Object
Returns a border from the
defaults.
defaults table.
|
static
Border
|
getBorder
(
Object
key,
Locale
Returns a border from the defaults
table
that is appropriate for the given locale. |
static
Color
|
getColor
(
Object
Returns a
drawing
color from the
defaults.
defaults table.
|
static
Color
|
getColor
(
Object
key,
Locale
Returns a
drawing
color from the defaults
table
that is appropriate for the given locale. |
static
String
|
getCrossPlatformLookAndFeelClassName
()
Returns the name of the LookAndFeel class that implements the default cross platform look and feel -- the Java Look and Feel (JLF). |
static
UIDefaults
|
getDefaults
()
Returns the
defaults.
default values for this look and feel.
|
static
Dimension
|
getDimension
(
Object
Returns a dimension from the
defaults.
defaults table.
|
static
Dimension
|
getDimension
(
Object
key,
Locale
Returns a dimension from the defaults
table
that is appropriate for the given locale. |
static
Font
|
getFont
(
Object
Returns a
drawing
font from the
defaults.
defaults table.
|
static
Font
|
getFont
(
Object
key,
Locale
Returns a
drawing
font from the defaults
table
that is appropriate for the given locale. |
static
Icon
|
getIcon
(
Object
Returns an Icon from the
defaults.
defaults table.
|
static
Icon
|
getIcon
(
Object
key,
Locale
Returns an Icon from the defaults
table
that is appropriate for the given locale. |
static
Insets
|
getInsets
(
Object
Returns an Insets object from the
defaults.
defaults table.
|
static
Insets
|
getInsets
(
Object
key,
Locale
Returns an Insets object from the defaults
table
that is appropriate for the given locale. |
static
UIManager.LookAndFeelInfo
|
getInstalledLookAndFeels
()
Returns an array of
LookAndFeelInfos representing
objects that provide some information about
the LookAndFeel implementations
currently available.
that have been installed with this software development kit.
|
static int |
getInt
(
Object
Returns an integer from the
defaults.
defaults table.
|
static int |
getInt
(
Object
key,
Locale
Returns an integer from the defaults
table
that is appropriate for the given locale. |
static
LookAndFeel
|
getLookAndFeel
()
Returns the current
default
look and feel or null. |
static
UIDefaults
|
getLookAndFeelDefaults
()
Returns the
UIDefaults from the current
default values for this
look and
feel, that were obtained at the time the look and feel was installed.
feel.
|
static
PropertyChangeListener
[] |
getPropertyChangeListeners
()
Returns an array of all the PropertyChangeListeners added to this UIManager with addPropertyChangeListener(). |
static
String
|
getString
(
Object
Returns a string from the
defaults.
defaults table.
|
static
String
|
getString
(
Object
key,
Locale
Returns a string from the defaults
table
that is appropriate for the given locale. |
static
String
|
getSystemLookAndFeelClassName
()
Returns the name of the LookAndFeel class that implements the native
system
systems
look and feel if there is one, otherwise the name of the default cross platform LookAndFeel class. |
static
ComponentUI
|
getUI
(
JComponent
Returns the
appropriate ComponentUI implementation for target.
L&F object that renders the target component.
|
static void |
installLookAndFeel
(
String
name,
String
Adds the specified
Creates a new
look and feel
and adds it
to the
set of available look and feels.
current array.
|
static void |
installLookAndFeel
(
UIManager.LookAndFeelInfo
Adds the specified look and feel to the
set of available look
current array
and
feels.
then calls
setInstalledLookAndFeels(javax.swing.UIManager.LookAndFeelInfo[])
|
static
Object
|
put
(
Object
key,
Object
Stores an object in the
developer defaults.
defaults table.
|
static boolean |
removeAuxiliaryLookAndFeel
(
LookAndFeel
laf)
Removes a LookAndFeel from the list of auxiliary look and feels. |
static void |
removePropertyChangeListener
(
PropertyChangeListener
listener)
Removes a PropertyChangeListener from the listener list. |
static void |
setInstalledLookAndFeels
(
UIManager.LookAndFeelInfo
Sets
Replaces
the
set
current array
of
available look and feels.
installed LookAndFeelInfos.
|
static void |
setLookAndFeel
(
LookAndFeel
Sets the current
default
look and feel
to newLookAndFeel.
using a LookAndFeel object.
|
static void |
setLookAndFeel
(
String
Loads
Sets
the
LookAndFeel specified by the given class name,
current default look and feel
using
the current thread's context
a
class
loader, and passes it to setLookAndFeel(LookAndFeel).
name.
|
Methods inherited from class java.lang.
Object
|
clone
,
equals
,
finalize
,
getClass
,
hashCode
,
notify
,
notifyAll
,
toString
,
wait
,
wait
,
wait
|
UIManager
public UIManager()
getInstalledLookAndFeels
public static UIManager.LookAndFeelInfo[] getInstalledLookAndFeels()
-
Returns an array of
LookAndFeelInfos representing
objects that provide some information about
the LookAndFeel implementations
currently available.
that have been installed with this software development kit.
The
LookAndFeelInfo
LookAndFeel info
objects can
be
used by an application to construct a menu of look and feel options for the
user,
user
or to
determine which
set the
look and feel
to set
at
startup
start up
time.
To avoid
Note that we do not return
the
penalty of creating numerous
LookAndFeel
objects, LookAndFeelInfo maintains
classes themselves here to avoid
the
class name
cost
of
the LookAndFeel class, not the actual LookAndFeel instance.
unnecessarily loading them.
The following example illustrates setting the current look and feel from an instance of LookAndFeelInfo:
Given a LookAndFeelInfo object one can set the current look and feel like this:
UIManager.setLookAndFeel(info.getClassName());
-
-
-
Returns:
-
an array of LookAndFeelInfo objects
-
See Also:
-
setLookAndFeel(javax.swing.LookAndFeel)
setInstalledLookAndFeels
public static void setInstalledLookAndFeels(UIManager.LookAndFeelInfo[] infos)
throws SecurityException
-
Sets the set of available look and feels. While this method does not check to ensure all of the LookAndFeelInfos are non-null, it is strongly recommended that only non-null values are supplied in the infos array.
Replaces the current array of installed LookAndFeelInfos.
-
-
-
Parameters:
-
infos -
set
new array
of LookAndFeelInfo objects
specifying the available look and feels
-
Throws:
-
NullPointerException
- if infos is null
-
SecurityException
-
See Also:
-
getInstalledLookAndFeels()
installLookAndFeel
public static void installLookAndFeel(UIManager.LookAndFeelInfo info)
-
Adds the specified look and feel to the set of available look and feels. While this method allows a null info, it is strongly recommended that a non-null value be used.
Adds the specified look and feel to the current array and then calls
setInstalledLookAndFeels(javax.swing.UIManager.LookAndFeelInfo[])
.
-
-
-
Parameters:
-
info - a LookAndFeelInfo object that names the look and feel and identifies
the
that
class that implements it -
See Also:
-
setInstalledLookAndFeels(javax.swing.UIManager.LookAndFeelInfo[])
installLookAndFeel
public static void installLookAndFeel(String name,
String className)
-
Adds the specified look and feel to the set of available look and feels. While this method does not check the arguments in any way, it is strongly recommended that non-null values be supplied.
Creates a new look and feel and adds it to the current array. Then calls
setInstalledLookAndFeels(javax.swing.UIManager.LookAndFeelInfo[])
.
-
-
-
Parameters:
-
name -
descriptive
a String specifying the
name of the look and feel -
className -
name of
a String specifying
the class
name
that implements the look and feel -
See Also:
-
setInstalledLookAndFeels(javax.swing.UIManager.LookAndFeelInfo[])
getLookAndFeel
public static LookAndFeel getLookAndFeel()
-
Returns the current
default
look and feel or null.
-
-
-
Returns:
-
the
current
default
look and feel, or null -
See Also:
-
setLookAndFeel(javax.swing.LookAndFeel)
setLookAndFeel
public static void setLookAndFeel(LookAndFeel newLookAndFeel)
throws UnsupportedLookAndFeelException
-
Sets the current look and feel to newLookAndFeel. If the current look and feel is non-null uninitialize is invoked on it. If newLookAndFeel is non-null, initialize is invoked on it followed by getDefaults. The defaults returned from newLookAndFeel.getDefaults() replace those of the defaults from the previous look and feel. If the newLookAndFeel is null, the look and feel defaults are set to null.
Sets the current default look and feel using a LookAndFeel object.
A value of null can be used to set the look and feel to null. As the LookAndFeel is required for most of Swing to function, setting the LookAndFeel to null is strongly discouraged.
This is a JavaBeans bound property.
-
-
-
Parameters:
-
newLookAndFeel -
the
LookAndFeel
to install
object
-
Throws:
-
UnsupportedLookAndFeelException
- if
newLookAndFeel
lnf.isSupportedLookAndFeel()
is
non-null and newLookAndFeel.isSupportedLookAndFeel() returns
false -
See Also:
-
getLookAndFeel()
setLookAndFeel
public static void setLookAndFeel(String className)
throws ClassNotFoundException,
InstantiationException,
IllegalAccessException,
UnsupportedLookAndFeelException
-
Loads the LookAndFeel specified by the given class name, using the current thread's context class loader, and passes it to setLookAndFeel(LookAndFeel).
Sets the current default look and feel using a class name.
-
-
-
Parameters:
-
className - a string specifying the name of the class that implements the look and feel
-
Throws:
-
ClassNotFoundException
- if the LookAndFeel class could not be found
-
InstantiationException
- if a new instance of the class couldn't be created
-
IllegalAccessException
- if the class or initializer isn't accessible
-
UnsupportedLookAndFeelException
- if lnf.isSupportedLookAndFeel() is false
-
ClassCastException
- if className does not identify a class that extends LookAndFeel
getSystemLookAndFeelClassName
public static String getSystemLookAndFeelClassName()
-
Returns the name of the LookAndFeel class that implements the native
system
systems
look and feel if there is one, otherwise the name of the default cross platform LookAndFeel class.
This
If the system property swing.systemlaf has been defined, its
value
can
will
be
overriden by setting the swing.systemlaf system property.
returned.
-
-
-
Returns:
-
the String of the LookAndFeel class
-
See Also:
-
setLookAndFeel(javax.swing.LookAndFeel)
,
getCrossPlatformLookAndFeelClassName()
getCrossPlatformLookAndFeelClassName
public static String getCrossPlatformLookAndFeelClassName()
-
Returns the name of the LookAndFeel class that implements the default cross platform look and feel -- the Java Look and Feel (JLF).
This value can be overriden by setting the swing.crossplatformlaf system property.
If the system property swing.crossplatformlaf has been defined, its value will be returned.
-
-
-
Returns:
-
a string with the JLF implementation-class
-
See Also:
-
setLookAndFeel(javax.swing.LookAndFeel)
,
getSystemLookAndFeelClassName()
getDefaults
public static UIDefaults getDefaults()
-
Returns the defaults. The returned defaults resolve using the logic specified in the class documentation.
Returns the default values for this look and feel.
-
-
-
Returns:
-
a UIDefaults object containing the default values
getFont
public static Font getFont(Object key)
-
Returns a font from the defaults. If the value for key is not a Font, null is returned.
Returns a drawing font from the defaults table.
-
-
-
Parameters:
-
key - an Object specifying the font
-
Returns:
-
the Font object
-
Throws:
-
NullPointerException
- if key is null
getFont
public static Font getFont(Object key,
Locale l)
-
Returns a
drawing
font from the defaults
table
that is appropriate for the given locale.
If the value for key is not a Font, null is returned.
-
-
-
Parameters:
-
key - an Object specifying the font
-
l - the Locale for which the font is
desired; refer to UIDefaults for details on how a null Locale is handled
desired
-
Returns:
-
the Font object
-
Throws:
-
NullPointerException
- if key is null
-
Since:
-
1.4
getColor
public static Color getColor(Object key)
-
Returns a color from the defaults. If the value for key is not a Color, null is returned.
Returns a drawing color from the defaults table.
-
-
-
Parameters:
-
key - an Object specifying the color
-
Returns:
-
the Color object
-
Throws:
-
NullPointerException
- if key is null
getColor
public static Color getColor(Object key,
Locale l)
-
Returns a
drawing
color from the defaults
table
that is appropriate for the given locale.
If the value for key is not a Color, null is returned.
-
-
-
Parameters:
-
key - an Object specifying the color
-
l - the Locale for which the color is
desired; refer to UIDefaults for details on how a null Locale is handled
desired
-
Returns:
-
the Color object
-
Throws:
-
NullPointerException
- if key is null
-
Since:
-
1.4
getIcon
public static Icon getIcon(Object key)
-
Returns an Icon from the defaults. If the value for key is not an Icon, null is returned.
Returns an Icon from the defaults table.
-
-
-
Parameters:
-
key - an Object specifying the icon
-
Returns:
-
the Icon object
-
Throws:
-
NullPointerException
- if key is null
getIcon
public static Icon getIcon(Object key,
Locale l)
-
Returns an Icon from the defaults
table
that is appropriate for the given locale.
If the value for key is not an Icon, null is returned.
-
-
-
Parameters:
-
key - an Object specifying the icon
-
l - the Locale for which the icon is
desired; refer to UIDefaults for details on how a null Locale is handled
desired
-
Returns:
-
the Icon object
-
Throws:
-
NullPointerException
- if key is null
-
Since:
-
1.4
getBorder
public static Border getBorder(Object key)
-
Returns a border from the defaults. If the value for key is not a Border, null is returned.
Returns a border from the defaults table.
-
-
-
Parameters:
-
key - an Object specifying the border
-
Returns:
-
the Border object
-
Throws:
-
NullPointerException
- if key is null
getBorder
public static Border getBorder(Object key,
Locale l)
-
Returns a border from the defaults
table
that is appropriate for the given locale.
If the value for key is not a Border, null is returned.
-
-
-
Parameters:
-
key - an Object specifying the border
-
l - the Locale for which the border is
desired; refer to UIDefaults for details on how a null Locale is handled
desired
-
Returns:
-
the Border object
-
Throws:
-
NullPointerException
- if key is null
-
Since:
-
1.4
getString
public static String getString(Object key)
-
Returns a string from the defaults. If the value for key is not a String, null is returned.
Returns a string from the defaults table.
-
-
-
Parameters:
-
key - an Object specifying the string
-
Returns:
-
the String
-
Throws:
-
NullPointerException
- if key is null
getString
public static String getString(Object key,
Locale l)
-
Returns a string from the defaults
table
that is appropriate for the given locale.
If the value for key is not a String, null is returned.
-
-
-
Parameters:
-
key - an Object specifying the string
-
l - the Locale for which the string is
desired; refer to UIDefaults for details on how a null Locale is handled
desired
-
Returns:
-
the String
-
Throws:
-
NullPointerException
- if key is null
-
Since:
-
1.4
getInt
public static int getInt(Object key)
-
Returns an integer from the defaults. If the value for key is not an Integer, or does not exist, 0 is returned.
Returns an integer from the defaults table.
-
-
-
Parameters:
-
key - an Object specifying the int
-
Returns:
-
the int
-
Throws:
-
NullPointerException
- if key is null
getInt
public static int getInt(Object key,
Locale l)
-
Returns an integer from the defaults
table
that is appropriate for the given locale.
If the value for key is not an Integer, or does not exist, 0 is returned.
-
-
-
Parameters:
-
key - an Object specifying the int
-
l - the Locale for which the int is
desired; refer to UIDefaults for details on how a null Locale is handled
desired
-
Returns:
-
the int
-
Throws:
-
NullPointerException
- if key is null
-
Since:
-
1.4
getBoolean
public static boolean getBoolean(Object key)
-
Returns a boolean from the defaults
table
which is associated with the key value. If the key is not found or the key doesn't represent a boolean value then false
is
will be
returned.
-
-
-
Parameters:
-
key - an Object specifying the key for the desired boolean value
-
Returns:
-
the boolean value corresponding to the key
-
Throws:
-
NullPointerException
- if key is null
-
Since:
-
1.4
getBoolean
public static boolean getBoolean(Object key,
Locale l)
-
Returns a boolean from the defaults
table
which is associated with the key value and the given Locale. If the key is not found or the key doesn't represent a boolean value then false will be returned.
-
-
-
Parameters:
-
key - an Object specifying the key for the desired boolean value
-
l - the Locale for which the boolean is
desired; refer to UIDefaults for details on how a null Locale is handled
desired
-
Returns:
-
the boolean value corresponding to the key
-
Throws:
-
NullPointerException
- if key is null
-
Since:
-
1.4
getInsets
public static Insets getInsets(Object key)
-
Returns an Insets object from the defaults. If the value for key is not an Insets, null is returned.
Returns an Insets object from the defaults table.
-
-
-
Parameters:
-
key - an Object specifying the Insets object
-
Returns:
-
the Insets object
-
Throws:
-
NullPointerException
- if key is null
getInsets
public static Insets getInsets(Object key,
Locale l)
-
Returns an Insets object from the defaults
table
that is appropriate for the given locale.
If the value for key is not an Insets, null is returned.
-
-
-
Parameters:
-
key - an Object specifying the Insets object
-
l - the Locale for which the object is
desired; refer to UIDefaults for details on how a null Locale is handled
desired
-
Returns:
-
the Insets object
-
Throws:
-
NullPointerException
- if key is null
-
Since:
-
1.4
getDimension
public static Dimension getDimension(Object key)
-
Returns a dimension from the defaults. If the value for key is not a Dimension, null is returned.
Returns a dimension from the defaults table.
-
-
-
Parameters:
-
key - an Object specifying the dimension object
-
Returns:
-
the Dimension object
-
Throws:
-
NullPointerException
- if key is null
getDimension
public static Dimension getDimension(Object key,
Locale l)
-
Returns a dimension from the defaults
table
that is appropriate for the given locale.
If the value for key is not a Dimension, null is returned.
-
-
-
Parameters:
-
key - an Object specifying the dimension object
-
l - the Locale for which the object is
desired; refer to UIDefaults for details on how a null Locale is handled
desired
-
Returns:
-
the Dimension object
-
Throws:
-
NullPointerException
- if key is null
-
Since:
-
1.4
get
public static Object get(Object key)
-
Returns an object from the
defaults.
defaults table.
-
-
-
Parameters:
-
key - an Object specifying the desired object
-
Returns:
-
the Object
-
Throws:
-
NullPointerException
- if key is null
get
public static Object get(Object key,
Locale l)
-
Returns an object from the defaults
table
that is appropriate for the given locale.
-
-
-
Parameters:
-
key - an Object specifying the desired object
-
l - the Locale for which the object is
desired; refer to UIDefaults for details on how a null Locale is handled
desired
-
Returns:
-
the Object
-
Throws:
-
NullPointerException
- if key is null
-
Since:
-
1.4
put
public static Object put(Object key,
Object value)
-
Stores an object in the developer defaults. This is a cover method for getDefaults().put(key, value). This only effects the developer defaults, not the system or look and feel defaults.
Stores an object in the defaults table.
-
-
-
Parameters:
-
key - an Object specifying the retrieval key
-
value - the Object to store; refer to UIDefaults for details on how null is handled
value - the Object to store
-
Returns:
-
the Object returned by
UIDefaults.put(java.lang.Object, java.lang.Object)
-
Throws:
-
NullPointerException
- if key is null
-
See Also:
-
UIDefaults.put(java.lang.Object, java.lang.Object)
getUI
public static ComponentUI getUI(JComponent target)
-
Returns the appropriate ComponentUI implementation for target. Typically, this is a cover for getDefaults().getUI(target). However, if an auxiliary look and feel has been installed, this first invokes getUI(target) on the multiplexing look and feel's defaults, and returns that value if it is non-null.
Returns the L&F object that renders the target component.
-
-
-
Parameters:
-
target - the JComponent to
return the ComponentUI for
render
-
Returns:
-
the ComponentUI object for target
-
Throws:
-
NullPointerException
- if target is null
-
See Also:
-
UIDefaults.getUI(javax.swing.JComponent)
the ComponentUI object that renders the target component
getLookAndFeelDefaults
public static UIDefaults getLookAndFeelDefaults()
-
Returns the UIDefaults from the current look and feel, that were obtained at the time the look and feel was installed.
Returns the default values for this look and feel.
In general, developers should use the UIDefaults returned from getDefaults(). As the current look and feel may expect certain values to exist, altering the UIDefaults returned from this method could have unexpected results.
-
-
-
Returns:
-
UIDefaults from the current look and feel
-
See Also:
-
getDefaults()
,
setLookAndFeel(LookAndFeel)
,
LookAndFeel.getDefaults()
an UIDefaults object containing the default values
addAuxiliaryLookAndFeel
public static void addAuxiliaryLookAndFeel(LookAndFeel laf)
-
Adds a LookAndFeel to the list of auxiliary look and feels. The auxiliary look and feels tell the multiplexing look and feel what other LookAndFeel classes for a component instance are to be used in addition to the default LookAndFeel class when creating a multiplexing UI. The change will only take effect when a new UI class is created or when the default look and feel is changed on a component instance.
Note these are not the same as the installed look and feels.
-
-
-
Parameters:
-
laf - the LookAndFeel object
-
See Also:
-
removeAuxiliaryLookAndFeel(javax.swing.LookAndFeel)
,
setLookAndFeel(javax.swing.LookAndFeel)
,
getAuxiliaryLookAndFeels()
,
getInstalledLookAndFeels()
removeAuxiliaryLookAndFeel
public static boolean removeAuxiliaryLookAndFeel(LookAndFeel laf)
-
Removes a LookAndFeel from the list of auxiliary look and feels. The auxiliary look and feels tell the multiplexing look and feel what other LookAndFeel classes for a component instance are to be used in addition to the default LookAndFeel class when creating a multiplexing UI. The change will only take effect when a new UI class is created or when the default look and feel is changed on a component instance.
Note these are not the same as the installed look and feels.
-
-
-
Returns:
-
true if the LookAndFeel was removed from the list
-
See Also:
-
removeAuxiliaryLookAndFeel(javax.swing.LookAndFeel)
,
getAuxiliaryLookAndFeels()
,
setLookAndFeel(javax.swing.LookAndFeel)
,
getInstalledLookAndFeels()
getAuxiliaryLookAndFeels
public static LookAndFeel[] getAuxiliaryLookAndFeels()
-
Returns the list of auxiliary look and feels (can be null). The auxiliary look and feels tell the multiplexing look and feel what other LookAndFeel classes for a component instance are to be used in addition to the default LookAndFeel class when creating a multiplexing UI.
Note these are not the same as the installed look and feels.
-
-
-
Returns:
-
list of auxiliary LookAndFeels or null
-
See Also:
-
addAuxiliaryLookAndFeel(javax.swing.LookAndFeel)
,
removeAuxiliaryLookAndFeel(javax.swing.LookAndFeel)
,
setLookAndFeel(javax.swing.LookAndFeel)
,
getInstalledLookAndFeels()
addPropertyChangeListener
public static void addPropertyChangeListener(PropertyChangeListener listener)
-
Adds a PropertyChangeListener to the listener list. The listener is registered for all properties.
-
-
-
Parameters:
-
listener - the PropertyChangeListener to be added
-
See Also:
-
PropertyChangeSupport
removePropertyChangeListener
public static void removePropertyChangeListener(PropertyChangeListener listener)
-
Removes a PropertyChangeListener from the listener list. This removes a PropertyChangeListener that was registered for all properties.
-
-
-
Parameters:
-
listener - the PropertyChangeListener to be removed
-
See Also:
-
PropertyChangeSupport
getPropertyChangeListeners
public static PropertyChangeListener[] getPropertyChangeListeners()
-
Returns an array of all the PropertyChangeListeners added to this UIManager with addPropertyChangeListener().
-
-
-
Returns:
-
all of the PropertyChangeListeners added or an empty array if no listeners have been added
-
Since:
-
1.4