uimanager (java platform se 7 )

Upload: pcdproyecto

Post on 02-Jun-2018

224 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/10/2019 UIManager (Java Platform SE 7 )

    1/12

    Overview Package Class Use Tree Deprecated Index HelpJava Platform

    Standard Ed. 7

    Prev Class Next Class Frames No Frames All Classes

    Summary:Nested| Field | Constr|Method Detail: Field |Constr|Method

    javax.swing

    Class UIManager

    java.lang.Object

    javax.swing.UIManager

    All Implemented Interfaces:

    Serializable

    public class UIManager

    extends Object

    implements Serializable

    UIManagermanages the current look and feel, the set of available look and feels,PropertyChangeListenersthat 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 ofLookAndFeeland passing it tosetLookAndFeel. The following example il lustrates 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 invokeupdateUIon all JComponents. The methodSwingUtilities.updateComponentTreeUI(java.awt.Component)makes it easy to apply updateUIto a containment hierarchy. Refer to it for details. Theexact behavior of not invoking updateUIafter changing the look and feel is unspecified. It is very possible to receive unexpected exceptions, painting problems, orworse.

    Default look and feel

    The class used for the default look and feel is chosen in the following manner:1. If the system propertyswing.defaultlafisnon-null, use its value as the default look and feel class name.2. If the Propertiesfile swing.propertiesexists and contains the key swing.defaultlaf, use its value as the default look and feel class name. The

    location that is checked forswing.propertiesmay vary depending upon the implementation of the Java platform. In Sun's implementation the location is${java.home}/lib/swing.properties. Refer to the release notes of the implementation being used for further details.

    3. Otherwise use the cross platform look and feel.

    Defaults

    UIManagermanages three sets of UIDefaults. In order, they are:1. Developer defaults. With few exceptions Swing does not alter the developer defaults; these are intended to be modified and used by the developer.2. 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 thegetLookAndFeelDefaults()method.3. Sytem defaults. The system defaults are provided by Swing.

    Invoking any of the various getmethods results in checking each of the defaults, in order, returning the first non-nullvalue. For example, invokingUIManager.getString("Table.foreground")results in first checking developer defaults. If the developer defaults contain a value for "Table.foreground"itis returned, otherwise the look and feel defaults are checked, followed by the system defaults.

    It's important to note thatgetDefaultsreturns a custom instance ofUIDefaultswith this resolution logic built into it. For example,UIManager.getDefaults().getString("Table.foreground")

    is equivalent toUIManager.getString("Table.foreground")

    . Both resolve using thealgorithm just described. In many places the documentation uses the word defaults to refer to the custom instance ofUIDefaultswith the resolution logic aspreviously described.

    When the look and feel is changed,UIManageralters only the look and feel defaults; the developer and system defaults are not altered by the UIManagerin anyway.

    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, orComponentUIprovided bya 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 maynot 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 andfeel. 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 expectscertain defaults, so that in general a ComponentUIprovided by one look and feel will not work with another look and feel.

    Warning:Serialized objects of this class wil l 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 JavaBeansTMhas been added to thejava.beanspackage. Please see XMLEncoder.

    Nested Class Summary

    Modifier and Type Class and Description

    static class UIManager.LookAndFeelInfo

    Provides a little information about an installed LookAndFeelfor the sake of confi urin a menu or for initial

    Nested Classes

    UIManager (Java Platform SE 7 ) 24/07/2014

    http://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html 1 / 12

    http://docs.oracle.com/javase/7/docs/api/overview-summary.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/package-summary.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.LookAndFeelInfo.htmlhttp://docs.oracle.com/javase/7/docs/api/java/beans/XMLEncoder.htmlhttp://docs.oracle.com/javase/7/docs/api/java/util/Properties.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/SwingUtilities.html#updateComponentTreeUI(java.awt.Component)http://docs.oracle.com/javase/7/docs/api/java/io/Serializable.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/7/docs/api/java/io/Serializable.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/7/docs/api/allclasses-noframe.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.htmlhttp://docs.oracle.com/javase/7/docs/api/index.html?javax/swing/UIManager.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.LookAndFeelInfo.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIDefaults.ProxyLazyValue.htmlhttp://docs.oracle.com/javase/7/docs/api/help-doc.htmlhttp://docs.oracle.com/javase/7/docs/api/index-files/index-1.htmlhttp://docs.oracle.com/javase/7/docs/api/deprecated-list.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/package-tree.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/class-use/UIManager.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/package-summary.htmlhttp://docs.oracle.com/javase/7/docs/api/overview-summary.html
  • 8/10/2019 UIManager (Java Platform SE 7 )

    2/12

    application set up.

    Constructor Summary

    Constructor and Description

    UIManager()

    Method Summary

    Modifier and Type Method and Description

    static void addAuxiliaryLookAndFeel(LookAndFeellaf)

    Adds a LookAndFeelto the lis t of auxiliary look and feels.

    static void addPropertyChangeListener(PropertyChangeListenerlistener)

    Adds a PropertyChangeListenerto the listener list.

    static Object get(Objectkey)

    Returns an object from the defaults.

    static Object get(Objectkey, Localel)Returns an object from the defaults that is appropriate for the given locale.

    static LookAndFeel[] getAuxiliaryLookAndFeels()

    Returns the list of auxiliary look and feels (can be null).

    static boolean getBoolean(Objectkey)

    Returns a boolean from the defaults which is associated with the key value.

    static boolean getBoolean(Objectkey, Localel)

    Returns a boolean from the defaults which is associated with the key value and the givenLocale.

    static Border getBorder(Objectkey)

    Returns a border from the defaults.

    static Border getBorder(Objectkey, Localel)

    Returns a border from the defaults that is appropriate for the given locale.

    static Color getColor(Objectkey)

    Returns a color from the defaults.static Color getColor(Objectkey, Localel)

    Returns a color from the defaults that is appropriate for the given locale.

    static String getCrossPlatformLookAndFeelClassName()

    Returns the name of the LookAndFeelclass that implements the default cross platform look and feel -- theJava Look and Feel (JLF).

    static UIDefaults getDefaults()

    Returns the defaults.

    static Dimension getDimension(Objectkey)

    Returns a dimension from the defaults.

    static Dimension getDimension(Objectkey, Localel)

    Returns a dimension from the defaults that is appropriate for the given locale.

    static Font getFont(Objectkey)

    Returns a font from the defaults.

    static Font getFont(Objectkey, Localel)

    Returns a font from the defaults that is appropriate for the given locale.

    static Icon getIcon(Objectkey)

    Returns anIconfrom the defaults.

    static Icon getIcon(Objectkey, Localel)

    Returns anIconfrom the defaults that is appropriate for the given locale.

    static Insets getInsets(Objectkey)

    Returns anInsetsobject from the defaults.

    static Insets getInsets(Objectkey, Localel)

    Returns anInsetsobject from the defaults that is appropriate for the given locale.

    static UIManager.LookAndFeelInfo[] getInstalledLookAndFeels()

    Returns an array of LookAndFeelInfos representing the LookAndFeelimplementations currently available.

    static int getInt(Objectkey)Returns an integer from the defaults.

    static int getInt(Objectkey, Localel)

    Returns an integer from the defaults that is appropriate for the given locale.

    static LookAndFeel getLookAndFeel()

    Returns the current look and feel or null.

    static UIDefaults getLookAndFeelDefaults()

    Constructors

    Methods

    UIManager (Java Platform SE 7 ) 24/07/2014

    http://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html 2 / 12

    http://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#getLookAndFeelDefaults()http://docs.oracle.com/javase/7/docs/api/javax/swing/UIDefaults.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#getLookAndFeel()http://docs.oracle.com/javase/7/docs/api/javax/swing/LookAndFeel.htmlhttp://docs.oracle.com/javase/7/docs/api/java/util/Locale.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#getInt(java.lang.Object,%20java.util.Locale)http://docs.oracle.com/javase/7/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#getInt(java.lang.Object)http://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#getInstalledLookAndFeels()http://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.LookAndFeelInfo.htmlhttp://docs.oracle.com/javase/7/docs/api/java/util/Locale.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#getInsets(java.lang.Object,%20java.util.Locale)http://docs.oracle.com/javase/7/docs/api/java/awt/Insets.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#getInsets(java.lang.Object)http://docs.oracle.com/javase/7/docs/api/java/awt/Insets.htmlhttp://docs.oracle.com/javase/7/docs/api/java/util/Locale.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#getIcon(java.lang.Object,%20java.util.Locale)http://docs.oracle.com/javase/7/docs/api/javax/swing/Icon.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#getIcon(java.lang.Object)http://docs.oracle.com/javase/7/docs/api/javax/swing/Icon.htmlhttp://docs.oracle.com/javase/7/docs/api/java/util/Locale.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#getFont(java.lang.Object,%20java.util.Locale)http://docs.oracle.com/javase/7/docs/api/java/awt/Font.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#getFont(java.lang.Object)http://docs.oracle.com/javase/7/docs/api/java/awt/Font.htmlhttp://docs.oracle.com/javase/7/docs/api/java/util/Locale.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#getDimension(java.lang.Object,%20java.util.Locale)http://docs.oracle.com/javase/7/docs/api/java/awt/Dimension.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#getDimension(java.lang.Object)http://docs.oracle.com/javase/7/docs/api/java/awt/Dimension.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#getDefaults()http://docs.oracle.com/javase/7/docs/api/javax/swing/UIDefaults.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#getCrossPlatformLookAndFeelClassName()http://docs.oracle.com/javase/7/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/7/docs/api/java/util/Locale.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#getColor(java.lang.Object,%20java.util.Locale)http://docs.oracle.com/javase/7/docs/api/java/awt/Color.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#getColor(java.lang.Object)http://docs.oracle.com/javase/7/docs/api/java/awt/Color.htmlhttp://docs.oracle.com/javase/7/docs/api/java/util/Locale.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#getBorder(java.lang.Object,%20java.util.Locale)http://docs.oracle.com/javase/7/docs/api/javax/swing/border/Border.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#getBorder(java.lang.Object)http://docs.oracle.com/javase/7/docs/api/javax/swing/border/Border.htmlhttp://docs.oracle.com/javase/7/docs/api/java/util/Locale.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#getBoolean(java.lang.Object,%20java.util.Locale)http://docs.oracle.com/javase/7/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#getBoolean(java.lang.Object)http://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#getAuxiliaryLookAndFeels()http://docs.oracle.com/javase/7/docs/api/javax/swing/LookAndFeel.htmlhttp://docs.oracle.com/javase/7/docs/api/java/util/Locale.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#get(java.lang.Object,%20java.util.Locale)http://docs.oracle.com/javase/7/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#get(java.lang.Object)http://docs.oracle.com/javase/7/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/7/docs/api/java/beans/PropertyChangeListener.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#addPropertyChangeListener(java.beans.PropertyChangeListener)http://docs.oracle.com/javase/7/docs/api/javax/swing/LookAndFeel.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#addAuxiliaryLookAndFeel(javax.swing.LookAndFeel)http://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#UIManager()
  • 8/10/2019 UIManager (Java Platform SE 7 )

    3/12

    Returns theUIDefaultsfrom the current look and feel, that were obtained at the time the look and feel wasinstalled.

    static PropertyChangeListener[] getPropertyChangeListeners()

    Returns an array of all the PropertyChangeListeners added to this UIManager withaddPropertyChangeListener().

    static String getString(Objectkey)

    Returns a string from the defaults.

    static String getString(Objectkey, Localel)

    Returns a string from the defaults that is appropriate for the given locale.

    static String getSystemLookAndFeelClassName()

    Returns the name of theLookAndFeel

    class that implements the native system look and feel if there is one,otherwise the name of the default cross platformLookAndFeelclass.

    static ComponentUI getUI(JComponenttarget)

    Returns the appropriateComponentUIimplementation fortarget.

    static void installLookAndFeel(Stringname, StringclassName)

    Adds the specified look and feel to the set of available look and feels.

    static void installLookAndFeel(UIManager.LookAndFeelInfoinfo)

    Adds the specified look and feel to the set of available look and feels.

    static Object put(Objectkey, Objectvalue)

    Stores an object in the developer defaults.

    static boolean removeAuxiliaryLookAndFeel(LookAndFeellaf)

    Removes aLookAndFeelfrom the list of auxiliary look and feels.

    static void removePropertyChangeListener(PropertyChangeListenerlistener)

    Removes aPropertyChangeListenerfrom the listener list.

    static void setInstalledLookAndFeels(UIManager.LookAndFeelInfo[] infos)

    Sets the set of available look and feels.

    static void setLookAndFeel(LookAndFeelnewLookAndFeel)

    Sets the current look and feel to newLookAndFeel.

    static void setLookAndFeel(StringclassName)

    Loads the LookAndFeelspecified by the given class name, using the current thread's context class loader,and passes it to setLookAndFeel(LookAndFeel).

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Constructor Detail

    UIManager

    public UIManager()

    Method Detail

    getInstalledLookAndFeels

    public static UIManager.LookAndFeelInfo[] getInstalledLookAndFeels()

    Returns an array of LookAndFeelInfos representing the LookAndFeelimplementations currently available. TheLookAndFeelInfoobjects can be usedby an application to construct a menu of look and feel options for the user, or to determine which look and feel to set at startup time. To avoid the penalty ofcreating numerous LookAndFeelobjects, LookAndFeelInfomaintains the class name of theLookAndFeelclass, not the actual LookAndFeelinstance.

    The following example il lustrates setting the current look and feel from an instance ofLookAndFeelInfo:

    UIManager.setLookAndFeel(info.getClassName());

    Returns:

    an array ofLookAndFeelInfoobjects

    See Also:

    setLookAndFeel(javax.swing.LookAndFeel)

    setInstalledLookAndFeels

    public static void setInstalledLookAndFeels(UIManager.LookAndFeelInfo[] infos)

    throws SecurityException

    UIManager (Java Platform SE 7 ) 24/07/2014

    http://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html 3 / 12

    http://docs.oracle.com/javase/7/docs/api/java/lang/SecurityException.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.LookAndFeelInfo.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#setLookAndFeel(javax.swing.LookAndFeel)http://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.LookAndFeelInfo.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/Object.html#wait(long,%20int)http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html#wait(long)http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html#wait()http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html#toString()http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html#notifyAll()http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html#notify()http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html#hashCode()http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html#getClass()http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html#finalize()http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html#equals(java.lang.Object)http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html#clone()http://docs.oracle.com/javase/7/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#setLookAndFeel(java.lang.String)http://docs.oracle.com/javase/7/docs/api/javax/swing/LookAndFeel.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#setLookAndFeel(javax.swing.LookAndFeel)http://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.LookAndFeelInfo.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#setInstalledLookAndFeels(javax.swing.UIManager.LookAndFeelInfo[])http://docs.oracle.com/javase/7/docs/api/java/beans/PropertyChangeListener.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#removePropertyChangeListener(java.beans.PropertyChangeListener)http://docs.oracle.com/javase/7/docs/api/javax/swing/LookAndFeel.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#removeAuxiliaryLookAndFeel(javax.swing.LookAndFeel)http://docs.oracle.com/javase/7/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#put(java.lang.Object,%20java.lang.Object)http://docs.oracle.com/javase/7/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.LookAndFeelInfo.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#installLookAndFeel(javax.swing.UIManager.LookAndFeelInfo)http://docs.oracle.com/javase/7/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#installLookAndFeel(java.lang.String,%20java.lang.String)http://docs.oracle.com/javase/7/docs/api/javax/swing/JComponent.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#getUI(javax.swing.JComponent)http://docs.oracle.com/javase/7/docs/api/javax/swing/plaf/ComponentUI.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#getSystemLookAndFeelClassName()http://docs.oracle.com/javase/7/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/7/docs/api/java/util/Locale.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#getString(java.lang.Object,%20java.util.Locale)http://docs.oracle.com/javase/7/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#getString(java.lang.Object)http://docs.oracle.com/javase/7/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#getPropertyChangeListeners()http://docs.oracle.com/javase/7/docs/api/java/beans/PropertyChangeListener.html
  • 8/10/2019 UIManager (Java Platform SE 7 )

    4/12

    Sets the set of available look and feels. While this method does not check to ensure all of the LookAndFeelInfosare non-null, it is stronglyrecommended that onlynon-nullvalues are supplied in the infosarray.

    Parameters:

    infos- set of LookAndFeelInfoobjects specifying the available look and feels

    Throws:

    NullPointerException- if infosisnull

    SecurityException

    See Also:

    getInstalledLookAndFeels()

    installLookAndFeel

    public static void installLookAndFeel(UIManager.LookAndFeelInfoinfo)

    Adds the specified look and feel to the set of available look and feels. While this method allows anullinfo, it is strongly recommended that anon-nullvalue be used.

    Parameters:

    info- a LookAndFeelInfoobject that names the look and feel and identifies the class that implements it

    See Also:

    setInstalledLookAndFeels(javax.swing.UIManager.LookAndFeelInfo[])

    installLookAndFeel

    public static void installLookAndFeel(Stringname,

    StringclassName)

    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 stronglyrecommended thatnon-nullvalues be supplied.

    Parameters:

    name- descriptive name of the look and feel

    className- name of the class that implements the look and feel

    See Also:

    setInstalledLookAndFeels(javax.swing.UIManager.LookAndFeelInfo[])

    getLookAndFeel

    public static LookAndFeelgetLookAndFeel()

    Returns the current look and feel or null.

    Returns:

    current look and feel, or null

    See Also:

    setLookAndFeel(javax.swing.LookAndFeel)

    setLookAndFeel

    public static void setLookAndFeel(LookAndFeelnewLookAndFeel)

    throws UnsupportedLookAndFeelException

    Sets the current look and feel to newLookAndFeel. If the current look and feel isnon-nulluninitializeis invoked on it. If newLookAndFeelisnon-null,initializeis invoked on it followed bygetDefaults. The defaults returned from newLookAndFeel.getDefaults()replace those of the defaults fromthe previous look and feel. If the newLookAndFeelisnull, the look and feel defaults are set tonull.

    A value ofnullcan be used to set the look and feel to null. As the LookAndFeelis required for most of Swing to function, setting the LookAndFeelto nullis s trongly discouraged.

    This is a JavaBeans bound property.

    Parameters:

    newLookAndFeel-LookAndFeelto install

    Throws:

    UnsupportedLookAndFeelException- if newLookAndFeelisnon-nulland newLookAndFeel.isSupportedLookAndFeel()returns false

    See Also:

    getLookAndFeel()

    UIManager (Java Platform SE 7 ) 24/07/2014

    http://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html 4 / 12

    http://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#getLookAndFeel()http://docs.oracle.com/javase/7/docs/api/javax/swing/UnsupportedLookAndFeelException.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UnsupportedLookAndFeelException.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/LookAndFeel.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#setLookAndFeel(javax.swing.LookAndFeel)http://docs.oracle.com/javase/7/docs/api/javax/swing/LookAndFeel.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#setInstalledLookAndFeels(javax.swing.UIManager.LookAndFeelInfo[])http://docs.oracle.com/javase/7/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#setInstalledLookAndFeels(javax.swing.UIManager.LookAndFeelInfo[])http://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.LookAndFeelInfo.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#getInstalledLookAndFeels()http://docs.oracle.com/javase/7/docs/api/java/lang/SecurityException.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.html
  • 8/10/2019 UIManager (Java Platform SE 7 )

    5/12

    setLookAndFeel

    public static void setLookAndFeel(StringclassName)

    throws ClassNotFoundException,

    InstantiationException,

    IllegalAccessException,

    UnsupportedLookAndFeelException

    Loads the LookAndFeelspecified by the given class name, using the current thread's context class loader, and passes it tosetLookAndFeel(LookAndFeel).

    Parameters:

    className- a string specifying the name of the class that implements the look and feel

    Throws:

    ClassNotFoundException- if the LookAndFeelclass 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 classNamedoes not identify a class that extends LookAndFeel

    getSystemLookAndFeelClassNamepublic static StringgetSystemLookAndFeelClassName()

    Returns the name of the LookAndFeelclass that implements the native system look and feel if there is one, otherwise the name of the default crossplatformLookAndFeelclass. This value can be overriden by setting the swing.systemlafsystem property.

    Returns:

    theStringof theLookAndFeelclass

    See Also:

    setLookAndFeel(javax.swing.LookAndFeel),getCrossPlatformLookAndFeelClassName()

    getCrossPlatformLookAndFeelClassName

    public static StringgetCrossPlatformLookAndFeelClassName()

    Returns the name of the LookAndFeelclass that implements the default cross platform look and feel -- the Java Look and Feel (JLF). This value can beoverriden by setting the swing.crossplatformlafsystem property.

    Returns:

    a string with the JLF implementation-class

    See Also:

    setLookAndFeel(javax.swing.LookAndFeel),getSystemLookAndFeelClassName()

    getDefaults

    public static UIDefaultsgetDefaults()

    Returns the defaults. The returned defaults resolve using the logic specified in the class documentation.

    Returns:

    a UIDefaultsobject containing the default values

    getFont

    public static FontgetFont(Objectkey)

    Returns a font from the defaults. If the value for keyis not a Font,nullis returned.

    Parameters:

    key- an Objectspecifying the font

    Returns:

    theFontobject

    Throws:

    NullPointerException- if keyisnull

    UIManager (Java Platform SE 7 ) 24/07/2014

    http://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html 5 / 12

    http://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/7/docs/api/java/awt/Font.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIDefaults.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#getSystemLookAndFeelClassName()http://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#setLookAndFeel(javax.swing.LookAndFeel)http://docs.oracle.com/javase/7/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#getCrossPlatformLookAndFeelClassName()http://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#setLookAndFeel(javax.swing.LookAndFeel)http://docs.oracle.com/javase/7/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/ClassCastException.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UnsupportedLookAndFeelException.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/IllegalAccessException.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/InstantiationException.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/ClassNotFoundException.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UnsupportedLookAndFeelException.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/IllegalAccessException.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/InstantiationException.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/ClassNotFoundException.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/String.html
  • 8/10/2019 UIManager (Java Platform SE 7 )

    6/12

    getFont

    public static FontgetFont(Objectkey,

    Localel)

    Returns a font from the defaults that is appropriate for the given locale. If the value for keyis not a Font,nullis returned.

    Parameters:

    key- an Objectspecifying the font

    l- the Localefor which the font is desired; refer toUIDefaultsfor details on how a nullLocaleis handled

    Returns:

    theFontobject

    Throws:

    NullPointerException- if keyisnull

    Since:

    1.4

    getColor

    public static ColorgetColor(Objectkey)

    Returns a color from the defaults. If the value for keyis not a Color,nullis returned.

    Parameters:

    key- an Objectspecifying the color

    Returns:

    theColorobject

    Throws:

    NullPointerException- if keyisnull

    getColor

    public static ColorgetColor(Objectkey, Localel)

    Returns a color from the defaults that is appropriate for the given locale. If the value for keyis not a Color,nullis returned.

    Parameters:

    key- an Objectspecifying the color

    l- the Localefor which the color is desired; refer toUIDefaultsfor details on how a nullLocaleis handled

    Returns:

    theColorobject

    Throws:

    NullPointerException- if keyisnull

    Since:

    1.4

    getIcon

    public static IcongetIcon(Objectkey)

    Returns anIconfrom the defaults. If the value forkeyis not an Icon,nullis returned.

    Parameters:

    key- an Objectspecifying the icon

    Returns:

    theIconobject

    Throws:

    NullPointerException- if keyisnull

    getIcon

    UIManager (Java Platform SE 7 ) 24/07/2014

    http://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html 6 / 12

    http://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/Icon.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.htmlhttp://docs.oracle.com/javase/7/docs/api/java/util/Locale.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/7/docs/api/java/awt/Color.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/7/docs/api/java/awt/Color.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.htmlhttp://docs.oracle.com/javase/7/docs/api/java/util/Locale.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/7/docs/api/java/awt/Font.html
  • 8/10/2019 UIManager (Java Platform SE 7 )

    7/12

    public static IcongetIcon(Objectkey,

    Localel)

    Returns anIconfrom the defaults that is appropriate for the given locale. If the value for keyis not an Icon,nullis returned.

    Parameters:

    key- an Objectspecifying the icon

    l- the Localefor which the icon is desired; refer toUIDefaultsfor details on how a nullLocaleis handled

    Returns:

    theIconobject

    Throws:

    NullPointerException- if keyisnull

    Since:

    1.4

    getBorder

    public static BordergetBorder(Objectkey)

    Returns a border from the defaults. If the value for keyis not a Border,nullis returned.

    Parameters:

    key- an Objectspecifying the borderReturns:

    theBorderobject

    Throws:

    NullPointerException- if keyisnull

    getBorder

    public static BordergetBorder(Objectkey,

    Localel)

    Returns a border from the defaults that is appropriate for the given locale. If the value for keyis not a Border,nullis returned.

    Parameters:

    key- an Objectspecifying the border

    l- the Localefor which the border is desired; refer toUIDefaultsfor details on how a nullLocaleis handled

    Returns:

    theBorderobject

    Throws:

    NullPointerException- if keyisnull

    Since:

    1.4

    getString

    public static StringgetString(Objectkey)

    Returns a string from the defaults. If the value forkeyis not a String,nullis returned.

    Parameters:

    key- an Objectspecifying the string

    Returns:

    theString

    Throws:

    NullPointerException- if keyisnull

    getString

    public static StringgetString(Objectkey,

    Localel)

    Returns a string from the defaults that is appropriate for the given locale. If the value for keyis not a String,nullis returned.

    UIManager (Java Platform SE 7 ) 24/07/2014

    http://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html 7 / 12

    http://docs.oracle.com/javase/7/docs/api/java/util/Locale.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/String.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.htmlhttp://docs.oracle.com/javase/7/docs/api/java/util/Locale.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/border/Border.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/border/Border.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.htmlhttp://docs.oracle.com/javase/7/docs/api/java/util/Locale.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/Icon.html
  • 8/10/2019 UIManager (Java Platform SE 7 )

    8/12

    Parameters:

    key- an Objectspecifying the string

    l- the Localefor which the string is desired; refer toUIDefaultsfor details on how a nullLocaleis handled

    Returns:

    theString

    Throws:

    NullPointerException- if keyisnull

    Since:

    1.4

    getInt

    public static int getInt(Objectkey)

    Returns an integer from the defaults. If the value for keyis not an Integer, or does not exist, 0is returned.

    Parameters:

    key- an Objectspecifying the int

    Returns:

    the int

    Throws:

    NullPointerException- if keyisnull

    getInt

    public static int getInt(Objectkey,

    Localel)

    Returns an integer from the defaults that is appropriate for the given locale. If the value for keyis not an Integer, or does not exist, 0is returned.

    Parameters:

    key- an Objectspecifying the int

    l- the Localefor which the int is desired; refer toUIDefaultsfor details on how a nullLocaleis handledReturns:

    the int

    Throws:

    NullPointerException- if keyisnull

    Since:

    1.4

    getBoolean

    public static boolean getBoolean(Objectkey)

    Returns a boolean from the defaults which is associated with the key value. If the key is not found or the key doesn't represent a boolean value thenfalseisreturned.

    Parameters:

    key- an Objectspecifying the key for the desired boolean value

    Returns:

    the boolean value corresponding to the key

    Throws:

    NullPointerException- if keyisnull

    Since:

    1.4

    getBoolean

    public static boolean getBoolean(Objectkey,

    Localel)

    Returns a boolean from the defaults which is associated with the ke value and the ivenLocale. If the ke is not found or the ke doesn't re resent a

    UIManager (Java Platform SE 7 ) 24/07/2014

    http://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html 8 / 12

    http://docs.oracle.com/javase/7/docs/api/java/util/Locale.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.htmlhttp://docs.oracle.com/javase/7/docs/api/java/util/Locale.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.html
  • 8/10/2019 UIManager (Java Platform SE 7 )

    9/12

    boolean value then falsewill be returned.

    Parameters:

    key- an Objectspecifying the key for the desired boolean value

    l- the Localefor which the boolean is desired; refer toUIDefaultsfor details on how a nullLocaleis handled

    Returns:

    the boolean value corresponding to the key

    Throws:

    NullPointerException- if keyisnull

    Since:

    1.4

    getInsets

    public static InsetsgetInsets(Objectkey)

    Returns anInsetsobject from the defaults. If the value for keyis not an Insets,nullis returned.

    Parameters:

    key- an Objectspecifying the Insetsobject

    Returns:

    theInsetsobject

    Throws:

    NullPointerException- if keyisnull

    getInsets

    public static InsetsgetInsets(Objectkey,

    Localel)

    Returns anInsetsobject from the defaults that is appropriate for the given locale. If the value forkeyis not an Insets,nullis returned.

    Parameters:

    key- an Objectspecifying the Insetsobject

    l- the Localefor which the object is desired; refer toUIDefaultsfor details on how a nullLocaleis handled

    Returns:

    theInsetsobject

    Throws:

    NullPointerException- if keyisnull

    Since:

    1.4

    getDimension

    public static DimensiongetDimension(Objectkey)

    Returns a dimension from the defaults. If the value forkeyis not a Dimension,nullis returned.

    Parameters:

    key- an Objectspecifying the dimension object

    Returns:

    theDimensionobject

    Throws:

    NullPointerException- if keyisnull

    getDimensionpublic static DimensiongetDimension(Objectkey,

    Localel)

    Returns a dimension from the defaults that is appropriate for the given locale. If the value for keyis not a Dimension,nullis returned.

    Parameters:

    UIManager (Java Platform SE 7 ) 24/07/2014

    http://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html 9 / 12

    http://docs.oracle.com/javase/7/docs/api/java/util/Locale.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/7/docs/api/java/awt/Dimension.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/7/docs/api/java/awt/Dimension.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.htmlhttp://docs.oracle.com/javase/7/docs/api/java/util/Locale.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/7/docs/api/java/awt/Insets.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/7/docs/api/java/awt/Insets.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.html
  • 8/10/2019 UIManager (Java Platform SE 7 )

    10/12

    key- an Objectspecifying the dimension object

    l- the Localefor which the object is desired; refer toUIDefaultsfor details on how a nullLocaleis handled

    Returns:

    theDimensionobject

    Throws:

    NullPointerException- if keyisnull

    Since:

    1.4

    get

    public static Objectget(Objectkey)

    Returns an object from the defaults.

    Parameters:

    key- an Objectspecifying the desired object

    Returns:

    theObject

    Throws:

    NullPointerException- if keyisnull

    get

    public static Objectget(Objectkey,

    Localel)

    Returns an object from the defaults that is appropriate for the given locale.

    Parameters:

    key- an Objectspecifying the desired object

    l- the Localefor which the object is desired; refer toUIDefaultsfor details on how a nullLocaleis handled

    Returns:

    theObject

    Throws:

    NullPointerException- if keyisnull

    Since:

    1.4

    put

    public static Objectput(Objectkey,

    Objectvalue)

    Stores an object in the developer defaults. This is a cover method forgetDefaults().put(key, value)

    . This only effects the developer defaults, not thesystem or look and feel defaults.

    Parameters:

    key- an Objectspecifying the retrieval key

    value- the Objectto store; refer toUIDefaultsfor details on how nullis handled

    Returns:

    theObjectreturned byUIDefaults.put(java.lang.Object, java.lang.Object)

    Throws:

    NullPointerException- if keyisnull

    See Also:

    UIDefaults.put(java.lang.Object, java.lang.Object)

    getUI

    public static ComponentUIgetUI(JComponenttarget)

    Returns the appropriateComponentUIimplementation fortarget. Typically, this is a cover for getDefaults().getUI(target). However, if an auxiliary

    UIManager (Java Platform SE 7 ) 24/07/2014

    http://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html 10 / 12

    http://docs.oracle.com/javase/7/docs/api/javax/swing/JComponent.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/plaf/ComponentUI.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIDefaults.html#put(java.lang.Object,%20java.lang.Object)http://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIDefaults.html#put(java.lang.Object,%20java.lang.Object)http://docs.oracle.com/javase/7/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.htmlhttp://docs.oracle.com/javase/7/docs/api/java/util/Locale.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/Object.htmlhttp://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.html
  • 8/10/2019 UIManager (Java Platform SE 7 )

    11/12

    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.

    Parameters:

    target- the JComponentto return the ComponentUIfor

    Returns:

    theComponentUIobject fortarget

    Throws:

    NullPointerException- if targetisnull

    See Also:

    UIDefaults.getUI(javax.swing.JComponent)

    getLookAndFeelDefaults

    public static UIDefaultsgetLookAndFeelDefaults()

    Returns theUIDefaultsfrom the current look and feel, that were obtained at the time the look and feel was installed.

    In general, developers should use theUIDefaultsreturned fromgetDefaults(). As the current look and feel may expect certain values to exist, alteringtheUIDefaultsreturned from this method could have unexpected results.

    Returns:

    UIDefaultsfrom the current look and feel

    See Also:

    getDefaults(),setLookAndFeel(LookAndFeel),LookAndFeel.getDefaults()

    addAuxiliaryLookAndFeel

    public static void addAuxiliaryLookAndFeel(LookAndFeellaf)

    Adds a LookAndFeelto the lis t of auxiliary look and feels. The auxiliary look and feels tell the multiplexing look and feel what otherLookAndFeelclasses fora component instance are to be used in addition to the defaultLookAndFeelclass when creating a multiplexing UI. The change will only take effect when anew 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

    LookAndFeelobject

    See Also:

    removeAuxiliaryLookAndFeel(javax.swing.LookAndFeel),setLookAndFeel(javax.swing.LookAndFeel),getAuxiliaryLookAndFeels(),getInstalledLookAndFeels()

    removeAuxiliaryLookAndFeel

    public static boolean removeAuxiliaryLookAndFeel(LookAndFeellaf)

    Removes aLookAndFeelfrom the list of auxiliary look and feels. The auxiliary look and feels tell the multiplexing look and feel what other LookAndFeelclasses for a component instance are to be used in addition to the defaultLookAndFeelclass when creating a multiplexing UI. The change will only takeeffect 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 LookAndFeelwas 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 otherLookAndFeelclasses for acomponent 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 auxiliaryLookAndFeels or null

    See Also:

    addAuxiliaryLookAndFeel(javax.swing.LookAndFeel),removeAuxiliaryLookAndFeel(javax.swing.LookAndFeel),

    UIManager (Java Platform SE 7 ) 24/07/2014

    http://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html 11 / 12

    http://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#removeAuxiliaryLookAndFeel(javax.swing.LookAndFeel)http://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#addAuxiliaryLookAndFeel(javax.swing.LookAndFeel)http://docs.oracle.com/javase/7/docs/api/javax/swing/LookAndFeel.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#getInstalledLookAndFeels()http://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#setLookAndFeel(javax.swing.LookAndFeel)http://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#getAuxiliaryLookAndFeels()http://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#removeAuxiliaryLookAndFeel(javax.swing.LookAndFeel)http://docs.oracle.com/javase/7/docs/api/javax/swing/LookAndFeel.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#getInstalledLookAndFeels()http://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#getAuxiliaryLookAndFeels()http://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#setLookAndFeel(javax.swing.LookAndFeel)http://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#removeAuxiliaryLookAndFeel(javax.swing.LookAndFeel)http://docs.oracle.com/javase/7/docs/api/javax/swing/LookAndFeel.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/LookAndFeel.html#getDefaults()http://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#setLookAndFeel(javax.swing.LookAndFeel)http://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#getDefaults()http://docs.oracle.com/javase/7/docs/api/javax/swing/UIDefaults.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIDefaults.html#getUI(javax.swing.JComponent)http://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.html
  • 8/10/2019 UIManager (Java Platform SE 7 )

    12/12

    Overview Package Class Use Tree Deprecated Index HelpJava Platform

    Standard Ed. 7

    Prev Class Next Class Frames No Frames All Classes

    Summary:Nested| Field | Constr|Method Detail: Field |Constr|Method

    Submit a bug or featureFor further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeteddescriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.Copyright 1993, 2014, Oracle and/or its affiliates. All rights reserved.

    setLookAndFeel(javax.swing.LookAndFeel),getInstalledLookAndFeels()

    addPropertyChangeListener

    public static void addPropertyChangeListener(PropertyChangeListenerlistener)

    Adds a PropertyChangeListenerto the listener list. The listener is registered for all properties.

    Parameters:

    listener- the PropertyChangeListenerto be added

    See Also:

    PropertyChangeSupport

    removePropertyChangeListener

    public static void removePropertyChangeListener(PropertyChangeListenerlistener)

    Removes aPropertyChangeListenerfrom the listener list. This removes a PropertyChangeListenerthat was registered for all properties.

    Parameters:

    listener- the PropertyChangeListenerto 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

    UIManager (Java Platform SE 7 ) 24/07/2014

    http://docs.oracle.com/javase/7/docs/legal/cpyr.htmlhttp://docs.oracle.com/javase/7/docs/index.htmlhttp://bugreport.sun.com/bugreport/http://docs.oracle.com/javase/7/docs/api/allclasses-noframe.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.htmlhttp://docs.oracle.com/javase/7/docs/api/index.html?javax/swing/UIManager.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.LookAndFeelInfo.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIDefaults.ProxyLazyValue.htmlhttp://docs.oracle.com/javase/7/docs/api/help-doc.htmlhttp://docs.oracle.com/javase/7/docs/api/index-files/index-1.htmlhttp://docs.oracle.com/javase/7/docs/api/deprecated-list.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/package-tree.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/class-use/UIManager.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/package-summary.htmlhttp://docs.oracle.com/javase/7/docs/api/overview-summary.htmlhttp://docs.oracle.com/javase/7/docs/api/java/beans/PropertyChangeListener.htmlhttp://docs.oracle.com/javase/7/docs/api/java/beans/PropertyChangeSupport.htmlhttp://docs.oracle.com/javase/7/docs/api/java/beans/PropertyChangeListener.htmlhttp://docs.oracle.com/javase/7/docs/api/java/beans/PropertyChangeSupport.htmlhttp://docs.oracle.com/javase/7/docs/api/java/beans/PropertyChangeListener.htmlhttp://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#getInstalledLookAndFeels()http://docs.oracle.com/javase/7/docs/api/javax/swing/UIManager.html#setLookAndFeel(javax.swing.LookAndFeel)