javax.swing
Class UIManager

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by javax.swing.UIManager
All Implemented Interfaces:
Serializable sample code for java.io.Serializable definition code for java.io.Serializable

public class UIManager
extends Object sample code for java.lang.Object definition code for java.lang.Object
implements Serializable sample code for java.io.Serializable definition code for java.io.Serializable

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:

  1. If the system property swing.defaultlaf is non-null, use it as the default look and feel class name.
  2. If the Properties sample code for java.util.Properties definition code for java.util.Properties file swing.properties exists and contains the key swing.defaultlaf, use its value as default look and feel class name. The location of swing.properties may vary depending upon the implementation of the Java platform. In Sun's implementation this will reside in &java.home>/lib/swing.properties. Refer to the release notes of the implementation you are using for further details.
  3. Otherwise use the Java look and feel.

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".

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 JavaBeansTM has been added to the java.beans package. Please see XMLEncoder sample code for java.beans.XMLEncoder definition code for java.beans.XMLEncoder .

See Also:
javax.swing.plaf.metal, Serialized Form

Nested Class Summary
static class UIManager.LookAndFeelInfo sample code for javax.swing.UIManager.LookAndFeelInfo definition code for javax.swing.UIManager.LookAndFeelInfo
          Provides a little information about an installed LookAndFeel for the sake of configuring a menu or for initial application set up.
 
Constructor Summary
UIManager sample code for javax.swing.UIManager.UIManager() definition code for javax.swing.UIManager.UIManager() ()
           
 
Method Summary
static void addAuxiliaryLookAndFeel sample code for javax.swing.UIManager.addAuxiliaryLookAndFeel(javax.swing.LookAndFeel) definition code for javax.swing.UIManager.addAuxiliaryLookAndFeel(javax.swing.LookAndFeel) (LookAndFeel sample code for javax.swing.LookAndFeel definition code for javax.swing.LookAndFeel  laf)
          Adds a LookAndFeel to the list of auxiliary look and feels.
static void addPropertyChangeListener sample code for javax.swing.UIManager.addPropertyChangeListener(java.beans.PropertyChangeListener) definition code for javax.swing.UIManager.addPropertyChangeListener(java.beans.PropertyChangeListener) (PropertyChangeListener sample code for java.beans.PropertyChangeListener definition code for java.beans.PropertyChangeListener  listener)
          Adds a PropertyChangeListener to the listener list.
static Object sample code for java.lang.Object definition code for java.lang.Object get sample code for javax.swing.UIManager.get(java.lang.Object) definition code for javax.swing.UIManager.get(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  key)
          Returns an object from the defaults table.
static Object sample code for java.lang.Object definition code for java.lang.Object get sample code for javax.swing.UIManager.get(java.lang.Object, java.util.Locale) definition code for javax.swing.UIManager.get(java.lang.Object, java.util.Locale) (Object sample code for java.lang.Object definition code for java.lang.Object  key, Locale sample code for java.util.Locale definition code for java.util.Locale  l)
          Returns an object from the defaults table that is appropriate for the given locale.
static LookAndFeel sample code for javax.swing.LookAndFeel definition code for javax.swing.LookAndFeel [] getAuxiliaryLookAndFeels sample code for javax.swing.UIManager.getAuxiliaryLookAndFeels() definition code for javax.swing.UIManager.getAuxiliaryLookAndFeels() ()
          Returns the list of auxiliary look and feels (can be null).
static boolean getBoolean sample code for javax.swing.UIManager.getBoolean(java.lang.Object) definition code for javax.swing.UIManager.getBoolean(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  key)
          Returns a boolean from the defaults table which is associated with the key value.
static boolean getBoolean sample code for javax.swing.UIManager.getBoolean(java.lang.Object, java.util.Locale) definition code for javax.swing.UIManager.getBoolean(java.lang.Object, java.util.Locale) (Object sample code for java.lang.Object definition code for java.lang.Object  key, Locale sample code for java.util.Locale definition code for java.util.Locale  l)
          Returns a boolean from the defaults table which is associated with the key value and the given Locale.
static Border sample code for javax.swing.border.Border definition code for javax.swing.border.Border getBorder sample code for javax.swing.UIManager.getBorder(java.lang.Object) definition code for javax.swing.UIManager.getBorder(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  key)
          Returns a border from the defaults table.
static Border sample code for javax.swing.border.Border definition code for javax.swing.border.Border getBorder sample code for javax.swing.UIManager.getBorder(java.lang.Object, java.util.Locale) definition code for javax.swing.UIManager.getBorder(java.lang.Object, java.util.Locale) (Object sample code for java.lang.Object definition code for java.lang.Object  key, Locale sample code for java.util.Locale definition code for java.util.Locale  l)
          Returns a border from the defaults table that is appropriate for the given locale.
static Color sample code for java.awt.Color definition code for java.awt.Color getColor sample code for javax.swing.UIManager.getColor(java.lang.Object) definition code for javax.swing.UIManager.getColor(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  key)
          Returns a drawing color from the defaults table.
static Color sample code for java.awt.Color definition code for java.awt.Color getColor sample code for javax.swing.UIManager.getColor(java.lang.Object, java.util.Locale) definition code for javax.swing.UIManager.getColor(java.lang.Object, java.util.Locale) (Object sample code for java.lang.Object definition code for java.lang.Object  key, Locale sample code for java.util.Locale definition code for java.util.Locale  l)
          Returns a drawing color from the defaults table that is appropriate for the given locale.
static String sample code for java.lang.String definition code for java.lang.String getCrossPlatformLookAndFeelClassName sample code for javax.swing.UIManager.getCrossPlatformLookAndFeelClassName() definition code for javax.swing.UIManager.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 sample code for javax.swing.UIDefaults definition code for javax.swing.UIDefaults getDefaults sample code for javax.swing.UIManager.getDefaults() definition code for javax.swing.UIManager.getDefaults() ()
          Returns the default values for this look and feel.
static Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension getDimension sample code for javax.swing.UIManager.getDimension(java.lang.Object) definition code for javax.swing.UIManager.getDimension(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  key)
          Returns a dimension from the defaults table.
static Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension getDimension sample code for javax.swing.UIManager.getDimension(java.lang.Object, java.util.Locale) definition code for javax.swing.UIManager.getDimension(java.lang.Object, java.util.Locale) (Object sample code for java.lang.Object definition code for java.lang.Object  key, Locale sample code for java.util.Locale definition code for java.util.Locale  l)
          Returns a dimension from the defaults table that is appropriate for the given locale.
static Font sample code for java.awt.Font definition code for java.awt.Font getFont sample code for javax.swing.UIManager.getFont(java.lang.Object) definition code for javax.swing.UIManager.getFont(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  key)
          Returns a drawing font from the defaults table.
static Font sample code for java.awt.Font definition code for java.awt.Font getFont sample code for javax.swing.UIManager.getFont(java.lang.Object, java.util.Locale) definition code for javax.swing.UIManager.getFont(java.lang.Object, java.util.Locale) (Object sample code for java.lang.Object definition code for java.lang.Object  key, Locale sample code for java.util.Locale definition code for java.util.Locale  l)
          Returns a drawing font from the defaults table that is appropriate for the given locale.
static Icon sample code for javax.swing.Icon definition code for javax.swing.Icon getIcon sample code for javax.swing.UIManager.getIcon(java.lang.Object) definition code for javax.swing.UIManager.getIcon(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  key)
          Returns an Icon from the defaults table.
static Icon sample code for javax.swing.Icon definition code for javax.swing.Icon getIcon sample code for javax.swing.UIManager.getIcon(java.lang.Object, java.util.Locale) definition code for javax.swing.UIManager.getIcon(java.lang.Object, java.util.Locale) (Object sample code for java.lang.Object definition code for java.lang.Object  key, Locale sample code for java.util.Locale definition code for java.util.Locale  l)
          Returns an Icon from the defaults table that is appropriate for the given locale.
static Insets sample code for java.awt.Insets definition code for java.awt.Insets getInsets sample code for javax.swing.UIManager.getInsets(java.lang.Object) definition code for javax.swing.UIManager.getInsets(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  key)
          Returns an Insets object from the defaults table.
static Insets sample code for java.awt.Insets definition code for java.awt.Insets getInsets sample code for javax.swing.UIManager.getInsets(java.lang.Object, java.util.Locale) definition code for javax.swing.UIManager.getInsets(java.lang.Object, java.util.Locale) (Object sample code for java.lang.Object definition code for java.lang.Object  key, Locale sample code for java.util.Locale definition code for java.util.Locale  l)
          Returns an Insets object from the defaults table that is appropriate for the given locale.
static UIManager.LookAndFeelInfo sample code for javax.swing.UIManager.LookAndFeelInfo definition code for javax.swing.UIManager.LookAndFeelInfo [] getInstalledLookAndFeels sample code for javax.swing.UIManager.getInstalledLookAndFeels() definition code for javax.swing.UIManager.getInstalledLookAndFeels() ()
          Returns an array of objects that provide some information about the LookAndFeel implementations that have been installed with this software development kit.
static int getInt sample code for javax.swing.UIManager.getInt(java.lang.Object) definition code for javax.swing.UIManager.getInt(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  key)
          Returns an integer from the defaults table.
static int getInt sample code for javax.swing.UIManager.getInt(java.lang.Object, java.util.Locale) definition code for javax.swing.UIManager.getInt(java.lang.Object, java.util.Locale) (Object sample code for java.lang.Object definition code for java.lang.Object  key, Locale sample code for java.util.Locale definition code for java.util.Locale  l)
          Returns an integer from the defaults table that is appropriate for the given locale.
static LookAndFeel sample code for javax.swing.LookAndFeel definition code for javax.swing.LookAndFeel getLookAndFeel sample code for javax.swing.UIManager.getLookAndFeel() definition code for javax.swing.UIManager.getLookAndFeel() ()
          Returns the current default look and feel or null.
static UIDefaults sample code for javax.swing.UIDefaults definition code for javax.swing.UIDefaults getLookAndFeelDefaults sample code for javax.swing.UIManager.getLookAndFeelDefaults() definition code for javax.swing.UIManager.getLookAndFeelDefaults() ()
          Returns the default values for this look and feel.
static PropertyChangeListener sample code for java.beans.PropertyChangeListener definition code for java.beans.PropertyChangeListener [] getPropertyChangeListeners sample code for javax.swing.UIManager.getPropertyChangeListeners() definition code for javax.swing.UIManager.getPropertyChangeListeners() ()
          Returns an array of all the PropertyChangeListeners added to this UIManager with addPropertyChangeListener().
static String sample code for java.lang.String definition code for java.lang.String getString sample code for javax.swing.UIManager.getString(java.lang.Object) definition code for javax.swing.UIManager.getString(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  key)
          Returns a string from the defaults table.
static String sample code for java.lang.String definition code for java.lang.String getString sample code for javax.swing.UIManager.getString(java.lang.Object, java.util.Locale) definition code for javax.swing.UIManager.getString(java.lang.Object, java.util.Locale) (Object sample code for java.lang.Object definition code for java.lang.Object  key, Locale sample code for java.util.Locale definition code for java.util.Locale  l)
          Returns a string from the defaults table that is appropriate for the given locale.
static String sample code for java.lang.String definition code for java.lang.String getSystemLookAndFeelClassName sample code for javax.swing.UIManager.getSystemLookAndFeelClassName() definition code for javax.swing.UIManager.getSystemLookAndFeelClassName() ()
          Returns the name of the 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 sample code for javax.swing.plaf.ComponentUI definition code for javax.swing.plaf.ComponentUI getUI sample code for javax.swing.UIManager.getUI(javax.swing.JComponent) definition code for javax.swing.UIManager.getUI(javax.swing.JComponent) (JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent  target)
          Returns the L&F object that renders the target component.
static void installLookAndFeel sample code for javax.swing.UIManager.installLookAndFeel(java.lang.String, java.lang.String) definition code for javax.swing.UIManager.installLookAndFeel(java.lang.String, java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  name, String sample code for java.lang.String definition code for java.lang.String  className)
          Creates a new look and feel and adds it to the current array.
static void installLookAndFeel sample code for javax.swing.UIManager.installLookAndFeel(javax.swing.UIManager.LookAndFeelInfo) definition code for javax.swing.UIManager.installLookAndFeel(javax.swing.UIManager.LookAndFeelInfo) (UIManager.LookAndFeelInfo sample code for javax.swing.UIManager.LookAndFeelInfo definition code for javax.swing.UIManager.LookAndFeelInfo  info)
          Adds the specified look and feel to the current array and then calls setInstalledLookAndFeels(javax.swing.UIManager.LookAndFeelInfo[]) sample code for javax.swing.UIManager.setInstalledLookAndFeels(javax.swing.UIManager.LookAndFeelInfo[]) definition code for javax.swing.UIManager.setInstalledLookAndFeels(javax.swing.UIManager.LookAndFeelInfo[]) .
static Object sample code for java.lang.Object definition code for java.lang.Object put sample code for javax.swing.UIManager.put(java.lang.Object, java.lang.Object) definition code for javax.swing.UIManager.put(java.lang.Object, java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  key, Object sample code for java.lang.Object definition code for java.lang.Object  value)
          Stores an object in the defaults table.
static boolean removeAuxiliaryLookAndFeel sample code for javax.swing.UIManager.removeAuxiliaryLookAndFeel(javax.swing.LookAndFeel) definition code for javax.swing.UIManager.removeAuxiliaryLookAndFeel(javax.swing.LookAndFeel) (LookAndFeel sample code for javax.swing.LookAndFeel definition code for javax.swing.LookAndFeel  laf)
          Removes a LookAndFeel from the list of auxiliary look and feels.
static void removePropertyChangeListener sample code for javax.swing.UIManager.removePropertyChangeListener(java.beans.PropertyChangeListener) definition code for javax.swing.UIManager.removePropertyChangeListener(java.beans.PropertyChangeListener) (PropertyChangeListener sample code for java.beans.PropertyChangeListener definition code for java.beans.PropertyChangeListener  listener)
          Removes a PropertyChangeListener from the listener list.
static void setInstalledLookAndFeels sample code for javax.swing.UIManager.setInstalledLookAndFeels(javax.swing.UIManager.LookAndFeelInfo[]) definition code for javax.swing.UIManager.setInstalledLookAndFeels(javax.swing.UIManager.LookAndFeelInfo[]) (UIManager.LookAndFeelInfo sample code for javax.swing.UIManager.LookAndFeelInfo definition code for javax.swing.UIManager.LookAndFeelInfo [] infos)
          Replaces the current array of installed LookAndFeelInfos.
static void setLookAndFeel sample code for javax.swing.UIManager.setLookAndFeel(javax.swing.LookAndFeel) definition code for javax.swing.UIManager.setLookAndFeel(javax.swing.LookAndFeel) (LookAndFeel sample code for javax.swing.LookAndFeel definition code for javax.swing.LookAndFeel  newLookAndFeel)
          Sets the current default look and feel using a LookAndFeel object.
static void setLookAndFeel sample code for javax.swing.UIManager.setLookAndFeel(java.lang.String) definition code for javax.swing.UIManager.setLookAndFeel(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  className)
          Sets the current default look and feel using a class name.
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

UIManager sample code for javax.swing.UIManager() definition code for javax.swing.UIManager()

public UIManager()
Method Detail

getInstalledLookAndFeels sample code for javax.swing.UIManager.getInstalledLookAndFeels() definition code for javax.swing.UIManager.getInstalledLookAndFeels()

public static UIManager.LookAndFeelInfo sample code for javax.swing.UIManager.LookAndFeelInfo definition code for javax.swing.UIManager.LookAndFeelInfo [] getInstalledLookAndFeels()
Returns an array of objects that provide some information about the LookAndFeel implementations that have been installed with this software development kit. The LookAndFeel info objects can used by an application to construct a menu of look and feel options for the user or to set the look and feel at start up time. Note that we do not return the LookAndFeel classes themselves here to avoid the cost of unnecessarily loading them.

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) sample code for javax.swing.UIManager.setLookAndFeel(javax.swing.LookAndFeel) definition code for javax.swing.UIManager.setLookAndFeel(javax.swing.LookAndFeel)

setInstalledLookAndFeels sample code for javax.swing.UIManager.setInstalledLookAndFeels(javax.swing.UIManager.LookAndFeelInfo[]) definition code for javax.swing.UIManager.setInstalledLookAndFeels(javax.swing.UIManager.LookAndFeelInfo[])

public static void setInstalledLookAndFeels(UIManager.LookAndFeelInfo sample code for javax.swing.UIManager.LookAndFeelInfo definition code for javax.swing.UIManager.LookAndFeelInfo [] infos)
                                     throws SecurityException sample code for java.lang.SecurityException definition code for java.lang.SecurityException 
Replaces the current array of installed LookAndFeelInfos.

Parameters:
infos - new array of LookAndFeelInfo objects
Throws:
SecurityException sample code for java.lang.SecurityException definition code for java.lang.SecurityException
See Also:
getInstalledLookAndFeels() sample code for javax.swing.UIManager.getInstalledLookAndFeels() definition code for javax.swing.UIManager.getInstalledLookAndFeels()

installLookAndFeel sample code for javax.swing.UIManager.installLookAndFeel(javax.swing.UIManager.LookAndFeelInfo) definition code for javax.swing.UIManager.installLookAndFeel(javax.swing.UIManager.LookAndFeelInfo)

public static void installLookAndFeel(UIManager.LookAndFeelInfo sample code for javax.swing.UIManager.LookAndFeelInfo definition code for javax.swing.UIManager.LookAndFeelInfo  info)
Adds the specified look and feel to the current array and then calls setInstalledLookAndFeels(javax.swing.UIManager.LookAndFeelInfo[]) sample code for javax.swing.UIManager.setInstalledLookAndFeels(javax.swing.UIManager.LookAndFeelInfo[]) definition code for javax.swing.UIManager.setInstalledLookAndFeels(javax.swing.UIManager.LookAndFeelInfo[]) .

Parameters:
info - a LookAndFeelInfo object that names the look and feel and identifies that class that implements it

installLookAndFeel sample code for javax.swing.UIManager.installLookAndFeel(java.lang.String, java.lang.String) definition code for javax.swing.UIManager.installLookAndFeel(java.lang.String, java.lang.String)

public static void installLookAndFeel(String sample code for java.lang.String definition code for java.lang.String  name,
                                      String sample code for java.lang.String definition code for java.lang.String  className)
Creates a new look and feel and adds it to the current array. Then calls setInstalledLookAndFeels(javax.swing.UIManager.LookAndFeelInfo[]) sample code for javax.swing.UIManager.setInstalledLookAndFeels(javax.swing.UIManager.LookAndFeelInfo[]) definition code for javax.swing.UIManager.setInstalledLookAndFeels(javax.swing.UIManager.LookAndFeelInfo[]) .

Parameters:
name - a String specifying the name of the look and feel
className - a String specifying the class name that implements the look and feel

getLookAndFeel sample code for javax.swing.UIManager.getLookAndFeel() definition code for javax.swing.UIManager.getLookAndFeel()

public static LookAndFeel sample code for javax.swing.LookAndFeel definition code for javax.swing.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) sample code for javax.swing.UIManager.setLookAndFeel(javax.swing.LookAndFeel) definition code for javax.swing.UIManager.setLookAndFeel(javax.swing.LookAndFeel)

setLookAndFeel sample code for javax.swing.UIManager.setLookAndFeel(javax.swing.LookAndFeel) definition code for javax.swing.UIManager.setLookAndFeel(javax.swing.LookAndFeel)

public static void setLookAndFeel(LookAndFeel sample code for javax.swing.LookAndFeel definition code for javax.swing.LookAndFeel  newLookAndFeel)
                           throws UnsupportedLookAndFeelException sample code for javax.swing.UnsupportedLookAndFeelException definition code for javax.swing.UnsupportedLookAndFeelException 
Sets the current default look and feel using a LookAndFeel object.

This is a JavaBeans bound property.

Parameters:
newLookAndFeel - the LookAndFeel object
Throws:
UnsupportedLookAndFeelException sample code for javax.swing.UnsupportedLookAndFeelException definition code for javax.swing.UnsupportedLookAndFeelException - if lnf.isSupportedLookAndFeel() is false
See Also:
getLookAndFeel() sample code for javax.swing.UIManager.getLookAndFeel() definition code for javax.swing.UIManager.getLookAndFeel()

setLookAndFeel sample code for javax.swing.UIManager.setLookAndFeel(java.lang.String) definition code for javax.swing.UIManager.setLookAndFeel(java.lang.String)

public static void setLookAndFeel(String sample code for java.lang.String definition code for java.lang.String  className)
                           throws ClassNotFoundException sample code for java.lang.ClassNotFoundException definition code for java.lang.ClassNotFoundException ,
                                  InstantiationException sample code for java.lang.InstantiationException definition code for java.lang.InstantiationException ,
                                  IllegalAccessException sample code for java.lang.IllegalAccessException definition code for java.lang.IllegalAccessException ,
                                  UnsupportedLookAndFeelException sample code for javax.swing.UnsupportedLookAndFeelException definition code for javax.swing.UnsupportedLookAndFeelException 
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 sample code for java.lang.ClassNotFoundException definition code for java.lang.ClassNotFoundException - if the LookAndFeel class could not be found
InstantiationException sample code for java.lang.InstantiationException definition code for java.lang.InstantiationException - if a new instance of the class couldn't be created
IllegalAccessException sample code for java.lang.IllegalAccessException definition code for java.lang.IllegalAccessException - if the class or initializer isn't accessible
UnsupportedLookAndFeelException sample code for javax.swing.UnsupportedLookAndFeelException definition code for javax.swing.UnsupportedLookAndFeelException - if lnf.isSupportedLookAndFeel() is false

getSystemLookAndFeelClassName sample code for javax.swing.UIManager.getSystemLookAndFeelClassName() definition code for javax.swing.UIManager.getSystemLookAndFeelClassName()

public static String sample code for java.lang.String definition code for java.lang.String  getSystemLookAndFeelClassName()
Returns the name of the LookAndFeel class that implements the native systems look and feel if there is one, otherwise the name of the default cross platform LookAndFeel class. If the system property swing.systemlaf has been defined, its value will be returned.

Returns:
the String of the LookAndFeel class
See Also:
setLookAndFeel(javax.swing.LookAndFeel) sample code for javax.swing.UIManager.setLookAndFeel(javax.swing.LookAndFeel) definition code for javax.swing.UIManager.setLookAndFeel(javax.swing.LookAndFeel) , getCrossPlatformLookAndFeelClassName() sample code for javax.swing.UIManager.getCrossPlatformLookAndFeelClassName() definition code for javax.swing.UIManager.getCrossPlatformLookAndFeelClassName()

getCrossPlatformLookAndFeelClassName sample code for javax.swing.UIManager.getCrossPlatformLookAndFeelClassName() definition code for javax.swing.UIManager.getCrossPlatformLookAndFeelClassName()

public static String sample code for java.lang.String definition code for java.lang.String  getCrossPlatformLookAndFeelClassName()
Returns the name of the LookAndFeel class that implements the default cross platform look and feel -- the Java Look and Feel (JLF). 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) sample code for javax.swing.UIManager.setLookAndFeel(javax.swing.LookAndFeel) definition code for javax.swing.UIManager.setLookAndFeel(javax.swing.LookAndFeel) , getSystemLookAndFeelClassName() sample code for javax.swing.UIManager.getSystemLookAndFeelClassName() definition code for javax.swing.UIManager.getSystemLookAndFeelClassName()

getDefaults sample code for javax.swing.UIManager.getDefaults() definition code for javax.swing.UIManager.getDefaults()

public static UIDefaults sample code for javax.swing.UIDefaults definition code for javax.swing.UIDefaults  getDefaults()
Returns the default values for this look and feel.

Returns:
a UIDefaults object containing the default values

getFont sample code for javax.swing.UIManager.getFont(java.lang.Object) definition code for javax.swing.UIManager.getFont(java.lang.Object)

public static Font sample code for java.awt.Font definition code for java.awt.Font  getFont(Object sample code for java.lang.Object definition code for java.lang.Object  key)
Returns a drawing font from the defaults table.

Parameters:
key - an Object specifying the font
Returns:
the Font object

getFont sample code for javax.swing.UIManager.getFont(java.lang.Object, java.util.Locale) definition code for javax.swing.UIManager.getFont(java.lang.Object, java.util.Locale)

public static Font sample code for java.awt.Font definition code for java.awt.Font  getFont(Object sample code for java.lang.Object definition code for java.lang.Object  key,
                           Locale sample code for java.util.Locale definition code for java.util.Locale  l)
Returns a drawing font from the defaults table that is appropriate for the given locale.

Parameters:
key - an Object specifying the font
l - the Locale for which the font is desired
Returns:
the Font object
Since:
1.4

getColor sample code for javax.swing.UIManager.getColor(java.lang.Object) definition code for javax.swing.UIManager.getColor(java.lang.Object)

public static Color sample code for java.awt.Color definition code for java.awt.Color  getColor(Object sample code for java.lang.Object definition code for java.lang.Object  key)
Returns a drawing color from the defaults table.

Parameters:
key - an Object specifying the color
Returns:
the Color object

getColor sample code for javax.swing.UIManager.getColor(java.lang.Object, java.util.Locale) definition code for javax.swing.UIManager.getColor(java.lang.Object, java.util.Locale)

public static Color sample code for java.awt.Color definition code for java.awt.Color  getColor(Object sample code for java.lang.Object definition code for java.lang.Object  key,
                             Locale sample code for java.util.Locale definition code for java.util.Locale  l)
Returns a drawing color from the defaults table that is appropriate for the given locale.

Parameters:
key - an Object specifying the color
l - the Locale for which the color is desired
Returns:
the Color object
Since:
1.4

getIcon sample code for javax.swing.UIManager.getIcon(java.lang.Object) definition code for javax.swing.UIManager.getIcon(java.lang.Object)

public static Icon sample code for javax.swing.Icon definition code for javax.swing.Icon  getIcon(Object sample code for java.lang.Object definition code for java.lang.Object  key)
Returns an Icon from the defaults table.

Parameters:
key - an Object specifying the icon
Returns:
the Icon object

getIcon sample code for javax.swing.UIManager.getIcon(java.lang.Object, java.util.Locale) definition code for javax.swing.UIManager.getIcon(java.lang.Object, java.util.Locale)

public static Icon sample code for javax.swing.Icon definition code for javax.swing.Icon  getIcon(Object sample code for java.lang.Object definition code for java.lang.Object  key,
                           Locale sample code for java.util.Locale definition code for java.util.Locale  l)
Returns an Icon from the defaults table that is appropriate for the given locale.

Parameters:
key - an Object specifying the icon
l - the Locale for which the icon is desired
Returns:
the Icon object
Since:
1.4

getBorder sample code for javax.swing.UIManager.getBorder(java.lang.Object) definition code for javax.swing.UIManager.getBorder(java.lang.Object)

public static Border sample code for javax.swing.border.Border definition code for javax.swing.border.Border  getBorder(Object sample code for java.lang.Object definition code for java.lang.Object  key)
Returns a border from the defaults table.

Parameters:
key - an Object specifying the border
Returns:
the Border object

getBorder sample code for javax.swing.UIManager.getBorder(java.lang.Object, java.util.Locale) definition code for javax.swing.UIManager.getBorder(java.lang.Object, java.util.Locale)

public static Border sample code for javax.swing.border.Border definition code for javax.swing.border.Border  getBorder(Object sample code for java.lang.Object definition code for java.lang.Object  key,
                               Locale sample code for java.util.Locale definition code for java.util.Locale  l)
Returns a border from the defaults table that is appropriate for the given locale.

Parameters:
key - an Object specifying the border
l - the Locale for which the border is desired
Returns:
the Border object
Since:
1.4

getString sample code for javax.swing.UIManager.getString(java.lang.Object) definition code for javax.swing.UIManager.getString(java.lang.Object)

public static String sample code for java.lang.String definition code for java.lang.String  getString(Object sample code for java.lang.Object definition code for java.lang.Object  key)
Returns a string from the defaults table.

Parameters:
key - an Object specifying the string
Returns:
the String

getString sample code for javax.swing.UIManager.getString(java.lang.Object, java.util.Locale) definition code for javax.swing.UIManager.getString(java.lang.Object, java.util.Locale)

public static String sample code for java.lang.String definition code for java.lang.String  getString(Object sample code for java.lang.Object definition code for java.lang.Object  key,
                               Locale sample code for java.util.Locale definition code for java.util.Locale  l)
Returns a string from the defaults table that is appropriate for the given locale.

Parameters:
key - an Object specifying the string
l - the Locale for which the string is desired
Returns:
the String

getInt sample code for javax.swing.UIManager.getInt(java.lang.Object) definition code for javax.swing.UIManager.getInt(java.lang.Object)

public static int getInt(Object sample code for java.lang.Object definition code for java.lang.Object  key)
Returns an integer from the defaults table.

Parameters:
key - an Object specifying the int
Returns:
the int

getInt sample code for javax.swing.UIManager.getInt(java.lang.Object, java.util.Locale) definition code for javax.swing.UIManager.getInt(java.lang.Object, java.util.Locale)

public static int getInt(Object sample code for java.lang.Object definition code for java.lang.Object  key,
                         Locale sample code for java.util.Locale definition code for java.util.Locale  l)
Returns an integer from the defaults table that is appropriate for the given locale.

Parameters:
key - an Object specifying the int
l - the Locale for which the int is desired
Returns:
the int
Since:
1.4

getBoolean sample code for javax.swing.UIManager.getBoolean(java.lang.Object) definition code for javax.swing.UIManager.getBoolean(java.lang.Object)

public static boolean getBoolean(Object sample code for java.lang.Object definition code for java.lang.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 will be returned.

Parameters:
key - an Object specifying the key for the desired boolean value
Returns:
the boolean value corresponding to the key
Since:
1.4

getBoolean sample code for javax.swing.UIManager.getBoolean(java.lang.Object, java.util.Locale) definition code for javax.swing.UIManager.getBoolean(java.lang.Object, java.util.Locale)

public static boolean getBoolean(Object sample code for java.lang.Object definition code for java.lang.Object  key,
                                 Locale sample code for java.util.Locale definition code for java.util.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
Returns:
the boolean value corresponding to the key
Since:
1.4

getInsets sample code for javax.swing.UIManager.getInsets(java.lang.Object) definition code for javax.swing.UIManager.getInsets(java.lang.Object)

public static Insets sample code for java.awt.Insets definition code for java.awt.Insets  getInsets(Object sample code for java.lang.Object definition code for java.lang.Object  key)
Returns an Insets object from the defaults table.

Parameters:
key - an Object specifying the Insets object
Returns:
the Insets object

getInsets sample code for javax.swing.UIManager.getInsets(java.lang.Object, java.util.Locale) definition code for javax.swing.UIManager.getInsets(java.lang.Object, java.util.Locale)

public static Insets sample code for java.awt.Insets definition code for java.awt.Insets  getInsets(Object sample code for java.lang.Object definition code for java.lang.Object  key,
                               Locale sample code for java.util.Locale definition code for java.util.Locale  l)
Returns an Insets object from the defaults table that is appropriate for the given locale.

Parameters:
key - an Object specifying the Insets object
l - the Locale for which the object is desired
Returns:
the Insets object
Since:
1.4

getDimension sample code for javax.swing.UIManager.getDimension(java.lang.Object) definition code for javax.swing.UIManager.getDimension(java.lang.Object)

public static Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension  getDimension(Object sample code for java.lang.Object definition code for java.lang.Object  key)
Returns a dimension from the defaults table.

Parameters:
key - an Object specifying the dimension object
Returns:
the Dimension object

getDimension sample code for javax.swing.UIManager.getDimension(java.lang.Object, java.util.Locale) definition code for javax.swing.UIManager.getDimension(java.lang.Object, java.util.Locale)

public static Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension  getDimension(Object sample code for java.lang.Object definition code for java.lang.Object  key,
                                     Locale sample code for java.util.Locale definition code for java.util.Locale  l)
Returns a dimension from the defaults table that is appropriate for the given locale.

Parameters:
key - an Object specifying the dimension object
l - the Locale for which the object is desired
Returns:
the Dimension object
Since:
1.4

get sample code for javax.swing.UIManager.get(java.lang.Object) definition code for javax.swing.UIManager.get(java.lang.Object)

public static Object sample code for java.lang.Object definition code for java.lang.Object  get(Object sample code for java.lang.Object definition code for java.lang.Object  key)
Returns an object from the defaults table.

Parameters:
key - an Object specifying the desired object
Returns:
the Object

get sample code for javax.swing.UIManager.get(java.lang.Object, java.util.Locale) definition code for javax.swing.UIManager.get(java.lang.Object, java.util.Locale)

public static Object sample code for java.lang.Object definition code for java.lang.Object  get(Object sample code for java.lang.Object definition code for java.lang.Object  key,
                         Locale sample code for java.util.Locale definition code for java.util.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
Returns:
the Object

put sample code for javax.swing.UIManager.put(java.lang.Object, java.lang.Object) definition code for javax.swing.UIManager.put(java.lang.Object, java.lang.Object)

public static Object sample code for java.lang.Object definition code for java.lang.Object  put(Object sample code for java.lang.Object definition code for java.lang.Object  key,
                         Object sample code for java.lang.Object definition code for java.lang.Object  value)
Stores an object in the defaults table.

Parameters:
key - an Object specifying the retrieval key
value - the Object to store
Returns:
the Object returned by UIDefaults.put(java.lang.Object, java.lang.Object) sample code for javax.swing.UIDefaults.put(java.lang.Object, java.lang.Object) definition code for javax.swing.UIDefaults.put(java.lang.Object, java.lang.Object)

getUI sample code for javax.swing.UIManager.getUI(javax.swing.JComponent) definition code for javax.swing.UIManager.getUI(javax.swing.JComponent)

public static ComponentUI sample code for javax.swing.plaf.ComponentUI definition code for javax.swing.plaf.ComponentUI  getUI(JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent  target)
Returns the L&F object that renders the target component.

Parameters:
target - the JComponent to render
Returns:
the ComponentUI object that renders the target component

getLookAndFeelDefaults sample code for javax.swing.UIManager.getLookAndFeelDefaults() definition code for javax.swing.UIManager.getLookAndFeelDefaults()

public static UIDefaults sample code for javax.swing.UIDefaults definition code for javax.swing.UIDefaults  getLookAndFeelDefaults()
Returns the default values for this look and feel.

Returns:
an UIDefaults object containing the default values

addAuxiliaryLookAndFeel sample code for javax.swing.UIManager.addAuxiliaryLookAndFeel(javax.swing.LookAndFeel) definition code for javax.swing.UIManager.addAuxiliaryLookAndFeel(javax.swing.LookAndFeel)

public static void addAuxiliaryLookAndFeel(LookAndFeel sample code for javax.swing.LookAndFeel definition code for javax.swing.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) sample code for javax.swing.UIManager.removeAuxiliaryLookAndFeel(javax.swing.LookAndFeel) definition code for javax.swing.UIManager.removeAuxiliaryLookAndFeel(javax.swing.LookAndFeel) , setLookAndFeel(javax.swing.LookAndFeel) sample code for javax.swing.UIManager.setLookAndFeel(javax.swing.LookAndFeel) definition code for javax.swing.UIManager.setLookAndFeel(javax.swing.LookAndFeel) , getAuxiliaryLookAndFeels() sample code for javax.swing.UIManager.getAuxiliaryLookAndFeels() definition code for javax.swing.UIManager.getAuxiliaryLookAndFeels() , getInstalledLookAndFeels() sample code for javax.swing.UIManager.getInstalledLookAndFeels() definition code for javax.swing.UIManager.getInstalledLookAndFeels()

removeAuxiliaryLookAndFeel sample code for javax.swing.UIManager.removeAuxiliaryLookAndFeel(javax.swing.LookAndFeel) definition code for javax.swing.UIManager.removeAuxiliaryLookAndFeel(javax.swing.LookAndFeel)

public static boolean removeAuxiliaryLookAndFeel(LookAndFeel sample code for javax.swing.LookAndFeel definition code for javax.swing.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) sample code for javax.swing.UIManager.removeAuxiliaryLookAndFeel(javax.swing.LookAndFeel) definition code for javax.swing.UIManager.removeAuxiliaryLookAndFeel(javax.swing.LookAndFeel) , getAuxiliaryLookAndFeels() sample code for javax.swing.UIManager.getAuxiliaryLookAndFeels() definition code for javax.swing.UIManager.getAuxiliaryLookAndFeels() , setLookAndFeel(javax.swing.LookAndFeel) sample code for javax.swing.UIManager.setLookAndFeel(javax.swing.LookAndFeel) definition code for javax.swing.UIManager.setLookAndFeel(javax.swing.LookAndFeel) , getInstalledLookAndFeels() sample code for javax.swing.UIManager.getInstalledLookAndFeels() definition code for javax.swing.UIManager.getInstalledLookAndFeels()

getAuxiliaryLookAndFeels sample code for javax.swing.UIManager.getAuxiliaryLookAndFeels() definition code for javax.swing.UIManager.getAuxiliaryLookAndFeels()

public static LookAndFeel sample code for javax.swing.LookAndFeel definition code for javax.swing.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) sample code for javax.swing.UIManager.addAuxiliaryLookAndFeel(javax.swing.LookAndFeel) definition code for javax.swing.UIManager.addAuxiliaryLookAndFeel(javax.swing.LookAndFeel) , removeAuxiliaryLookAndFeel(javax.swing.LookAndFeel) sample code for javax.swing.UIManager.removeAuxiliaryLookAndFeel(javax.swing.LookAndFeel) definition code for javax.swing.UIManager.removeAuxiliaryLookAndFeel(javax.swing.LookAndFeel) , setLookAndFeel(javax.swing.LookAndFeel) sample code for javax.swing.UIManager.setLookAndFeel(javax.swing.LookAndFeel) definition code for javax.swing.UIManager.setLookAndFeel(javax.swing.LookAndFeel) , getInstalledLookAndFeels() sample code for javax.swing.UIManager.getInstalledLookAndFeels() definition code for javax.swing.UIManager.getInstalledLookAndFeels()

addPropertyChangeListener sample code for javax.swing.UIManager.addPropertyChangeListener(java.beans.PropertyChangeListener) definition code for javax.swing.UIManager.addPropertyChangeListener(java.beans.PropertyChangeListener)

public static void addPropertyChangeListener(PropertyChangeListener sample code for java.beans.PropertyChangeListener definition code for java.beans.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 sample code for java.beans.PropertyChangeSupport definition code for java.beans.PropertyChangeSupport

removePropertyChangeListener sample code for javax.swing.UIManager.removePropertyChangeListener(java.beans.PropertyChangeListener) definition code for javax.swing.UIManager.removePropertyChangeListener(java.beans.PropertyChangeListener)

public static void removePropertyChangeListener(PropertyChangeListener sample code for java.beans.PropertyChangeListener definition code for java.beans.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 sample code for java.beans.PropertyChangeSupport definition code for java.beans.PropertyChangeSupport

getPropertyChangeListeners sample code for javax.swing.UIManager.getPropertyChangeListeners() definition code for javax.swing.UIManager.getPropertyChangeListeners()

public static PropertyChangeListener sample code for java.beans.PropertyChangeListener definition code for java.beans.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