Java Doc for UIManager.java in  » 6.0-JDK-Core » swing » javax » swing » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » swing » javax.swing 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javax.swing.UIManager

UIManager
public class UIManager implements Serializable(Code)
UIManager manages the current look and feel, the set of available look and feels, PropertyChangeListeners that are notified when the look and feel changes, look and feel defaults, and convenience methods for obtaining various default values.

Specifying the look and feel

The look and feel can be specified in two distinct ways: by specifying the fully qualified name of the class for the look and feel, or by creating an instance of LookAndFeel and passing it to setLookAndFeel . The following example illustrates setting the look and feel to the system look and feel:
 UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
 
The following example illustrates setting the look and feel based on class name:
 UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
 
Once the look and feel has been changed it is imperative to invoke updateUI on all JComponents . The method SwingUtilities.updateComponentTreeUI makes it easy to apply updateUI to a containment hierarchy. Refer to it for details. The exact behavior of not invoking updateUI after changing the look and feel is unspecified. It is very possible to receive unexpected exceptions, painting problems, or worse.

Default look and feel

The class used for the default look and feel is chosen in the following manner:
  1. If the system property swing.defaultlaf is non-null , use its value as the default look and feel class name.
  2. If the java.util.Properties file swing.properties exists and contains the key swing.defaultlaf, use its value as the default look and feel class name. The location that is checked for swing.properties may 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

UIManager manages 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 the getLookAndFeelDefaults() method.
  3. Sytem defaults. The system defaults are provided by Swing.
Invoking any of the various get methods results in checking each of the defaults, in order, returning the first non-null value. For example, invoking UIManager.getString("Table.foreground") results in first checking developer defaults. If the developer defaults contain a value for "Table.foreground" it is returned, otherwise the look and feel defaults are checked, followed by the system defaults.

It's important to note that getDefaults returns a custom instance of UIDefaults with this resolution logic built into it. For example, UIManager.getDefaults().getString("Table.foreground") is equivalent to UIManager.getString("Table.foreground") . Both resolve using the algorithm just described. In many places the documentation uses the word defaults to refer to the custom instance of UIDefaults with the resolution logic as previously described.

When the look and feel is changed, UIManager alters only the look and feel defaults; the developer and system defaults are not altered by the UIManager in any way.

The set of defaults a particular look and feel supports is defined and documented by that look and feel. In addition, each look and feel, or ComponentUI provided by a look and feel, may access the defaults at different times in their life cycle. Some look and feels may agressively look up defaults, so that changing a default may not have an effect after installing the look and feel. Other look and feels may lazily access defaults so that a change to the defaults may effect an existing look and feel. Finally, other look and feels might not configure themselves from the defaults table in any way. None-the-less it is usually the case that a look and feel expects certain defaults, so that in general a ComponentUI provided by one look and feel will not work with another look and feel.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeansTM has been added to the java.beans package. Please see java.beans.XMLEncoder .
version:
   1.134 06/07/07
author:
   Thomas Ball
author:
   Hans Muller


Inner Class :public static class LookAndFeelInfo



Method Summary
public static  voidaddAuxiliaryLookAndFeel(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.
public static  voidaddPropertyChangeListener(PropertyChangeListener listener)
     Adds a PropertyChangeListener to the listener list.
public static  Objectget(Object key)
     Returns an object from the defaults.
public static  Objectget(Object key, Locale l)
     Returns an object from the defaults that is appropriate for the given locale.
public static  LookAndFeel[]getAuxiliaryLookAndFeels()
     Returns the list of auxiliary look and feels (can be null). The auxiliary look and feels tell the multiplexing look and feel what other LookAndFeel classes for a component instance are to be used in addition to the default LookAndFeel class when creating a multiplexing UI.
public static  booleangetBoolean(Object key)
     Returns a boolean from the defaults which is associated with the key value.
public static  booleangetBoolean(Object key, Locale l)
     Returns a boolean from the defaults which is associated with the key value and the given Locale.
public static  BordergetBorder(Object key)
     Returns a border from the defaults.
public static  BordergetBorder(Object key, Locale l)
     Returns a border from the defaults that is appropriate for the given locale.
public static  ColorgetColor(Object key)
     Returns a color from the defaults.
public static  ColorgetColor(Object key, Locale l)
     Returns a color from the defaults that is appropriate for the given locale.
public static  StringgetCrossPlatformLookAndFeelClassName()
     Returns the name of the LookAndFeel class that implements the default cross platform look and feel -- the Java Look and Feel (JLF).
public static  UIDefaultsgetDefaults()
     Returns the defaults.
public static  DimensiongetDimension(Object key)
     Returns a dimension from the defaults.
public static  DimensiongetDimension(Object key, Locale l)
     Returns a dimension from the defaults that is appropriate for the given locale.
public static  FontgetFont(Object key)
     Returns a font from the defaults.
public static  FontgetFont(Object key, Locale l)
     Returns a font from the defaults that is appropriate for the given locale.
public static  IcongetIcon(Object key)
     Returns an Icon from the defaults.
public static  IcongetIcon(Object key, Locale l)
     Returns an Icon from the defaults that is appropriate for the given locale.
public static  InsetsgetInsets(Object key)
     Returns an Insets object from the defaults.
public static  InsetsgetInsets(Object key, Locale l)
     Returns an Insets object from the defaults that is appropriate for the given locale.
public static  LookAndFeelInfo[]getInstalledLookAndFeels()
     Returns an array of LookAndFeelInfo s representing the LookAndFeel implementations currently available.
public static  intgetInt(Object key)
     Returns an integer from the defaults.
public static  intgetInt(Object key, Locale l)
     Returns an integer from the defaults that is appropriate for the given locale.
public static  LookAndFeelgetLookAndFeel()
     Returns the current look and feel or null.
public static  UIDefaultsgetLookAndFeelDefaults()
     Returns the UIDefaults from the current look and feel, that were obtained at the time the look and feel was installed.

In general, developers should use the UIDefaults returned from getDefaults() .

public static  PropertyChangeListener[]getPropertyChangeListeners()
     Returns an array of all the PropertyChangeListeners added to this UIManager with addPropertyChangeListener().
public static  StringgetString(Object key)
     Returns a string from the defaults.
public static  StringgetString(Object key, Locale l)
     Returns a string from the defaults that is appropriate for the given locale.
static  StringgetString(Object key, Component c)
     Returns a string from the defaults that is appropriate for the given locale.
public static  StringgetSystemLookAndFeelClassName()
     Returns the name of the LookAndFeel class that implements the native system look and feel if there is one, otherwise the name of the default cross platform LookAndFeel class.
public static  ComponentUIgetUI(JComponent target)
     Returns the appropriate ComponentUI implementation for target .
public static  voidinstallLookAndFeel(LookAndFeelInfo info)
     Adds the specified look and feel to the set of available look and feels.
public static  voidinstallLookAndFeel(String name, String className)
     Adds the specified look and feel to the set of available look and feels.
public static  Objectput(Object key, Object value)
     Stores an object in the developer defaults.
public static  booleanremoveAuxiliaryLookAndFeel(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.
public static  voidremovePropertyChangeListener(PropertyChangeListener listener)
     Removes a PropertyChangeListener from the listener list.
public static  voidsetInstalledLookAndFeels(LookAndFeelInfo[] infos)
     Sets the set of available look and feels.
public static  voidsetLookAndFeel(LookAndFeel newLookAndFeel)
     Sets the current look and feel to newLookAndFeel .
public static  voidsetLookAndFeel(String className)
     Loads the LookAndFeel specified by the given class name, using the current thread's context class loader, and passes it to setLookAndFeel(LookAndFeel) .



Method Detail
addAuxiliaryLookAndFeel
public static void addAuxiliaryLookAndFeel(LookAndFeel laf)(Code)
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:   UIManager.removeAuxiliaryLookAndFeel
See Also:   UIManager.setLookAndFeel
See Also:   UIManager.getAuxiliaryLookAndFeels
See Also:   UIManager.getInstalledLookAndFeels




addPropertyChangeListener
public static void addPropertyChangeListener(PropertyChangeListener listener)(Code)
Adds a PropertyChangeListener to the listener list. The listener is registered for all properties.
Parameters:
  listener - the PropertyChangeListener to be added
See Also:   java.beans.PropertyChangeSupport



get
public static Object get(Object key)(Code)
Returns an object from the defaults.
Parameters:
  key - an Object specifying the desired object the Object
throws:
  NullPointerException - if key is null



get
public static Object get(Object key, Locale l)(Code)
Returns an object from the defaults that is appropriate for the given locale.
Parameters:
  key - an Object specifying the desired object
Parameters:
  l - the Locale for which the object is desired; referto UIDefaults for details on how a null Locale is handled the Object
throws:
  NullPointerException - if key is null
since:
   1.4



getAuxiliaryLookAndFeels
public static LookAndFeel[] getAuxiliaryLookAndFeels()(Code)
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. list of auxiliary LookAndFeels or null
See Also:   UIManager.addAuxiliaryLookAndFeel
See Also:   UIManager.removeAuxiliaryLookAndFeel
See Also:   UIManager.setLookAndFeel
See Also:   UIManager.getInstalledLookAndFeels




getBoolean
public static boolean getBoolean(Object key)(Code)
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 then false is returned.
Parameters:
  key - an Object specifying the key for the desired boolean value the boolean value corresponding to the key
throws:
  NullPointerException - if key is null
since:
   1.4



getBoolean
public static boolean getBoolean(Object key, Locale l)(Code)
Returns a boolean from the defaults 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
Parameters:
  l - the Locale for which the boolean is desired; referto UIDefaults for details on how a null Locale is handled the boolean value corresponding to the key
throws:
  NullPointerException - if key is null
since:
   1.4



getBorder
public static Border getBorder(Object key)(Code)
Returns a border from the defaults. If the value for key is not a Border , null is returned.
Parameters:
  key - an Object specifying the border the Border object
throws:
  NullPointerException - if key is null



getBorder
public static Border getBorder(Object key, Locale l)(Code)
Returns a border from the defaults that is appropriate for the given locale. If the value for key is not a Border , null is returned.
Parameters:
  key - an Object specifying the border
Parameters:
  l - the Locale for which the border is desired; referto UIDefaults for details on how a null Locale is handled the Border object
throws:
  NullPointerException - if key is null
since:
   1.4



getColor
public static Color getColor(Object key)(Code)
Returns a color from the defaults. If the value for key is not a Color , null is returned.
Parameters:
  key - an Object specifying the color the Color object
throws:
  NullPointerException - if key is null



getColor
public static Color getColor(Object key, Locale l)(Code)
Returns a color from the defaults that is appropriate for the given locale. If the value for key is not a Color , null is returned.
Parameters:
  key - an Object specifying the color
Parameters:
  l - the Locale for which the color is desired; referto UIDefaults for details on how a null Locale is handled the Color object
throws:
  NullPointerException - if key is null
since:
   1.4



getCrossPlatformLookAndFeelClassName
public static String getCrossPlatformLookAndFeelClassName()(Code)
Returns the name of the LookAndFeel class that implements the default cross platform look and feel -- the Java Look and Feel (JLF). This value can be overriden by setting the swing.crossplatformlaf system property. a string with the JLF implementation-class
See Also:   UIManager.setLookAndFeel
See Also:   UIManager.getSystemLookAndFeelClassName



getDefaults
public static UIDefaults getDefaults()(Code)
Returns the defaults. The returned defaults resolve using the logic specified in the class documentation. a UIDefaults object containing the default values



getDimension
public static Dimension getDimension(Object key)(Code)
Returns a dimension from the defaults. If the value for key is not a Dimension , null is returned.
Parameters:
  key - an Object specifying the dimension object the Dimension object
throws:
  NullPointerException - if key is null



getDimension
public static Dimension getDimension(Object key, Locale l)(Code)
Returns a dimension from the defaults that is appropriate for the given locale. If the value for key is not a Dimension , null is returned.
Parameters:
  key - an Object specifying the dimension object
Parameters:
  l - the Locale for which the object is desired; referto UIDefaults for details on how a null Locale is handled the Dimension object
throws:
  NullPointerException - if key is null
since:
   1.4



getFont
public static Font getFont(Object key)(Code)
Returns a font from the defaults. If the value for key is not a Font , null is returned.
Parameters:
  key - an Object specifying the font the Font object
throws:
  NullPointerException - if key is null



getFont
public static Font getFont(Object key, Locale l)(Code)
Returns a font from the defaults that is appropriate for the given locale. If the value for key is not a Font , null is returned.
Parameters:
  key - an Object specifying the font
Parameters:
  l - the Locale for which the font is desired; referto UIDefaults for details on how a null Locale is handled the Font object
throws:
  NullPointerException - if key is null
since:
   1.4



getIcon
public static Icon getIcon(Object key)(Code)
Returns an Icon from the defaults. If the value for key is not an Icon , null is returned.
Parameters:
  key - an Object specifying the icon the Icon object
throws:
  NullPointerException - if key is null



getIcon
public static Icon getIcon(Object key, Locale l)(Code)
Returns an Icon from the defaults that is appropriate for the given locale. If the value for key is not an Icon , null is returned.
Parameters:
  key - an Object specifying the icon
Parameters:
  l - the Locale for which the icon is desired; referto UIDefaults for details on how a null Locale is handled the Icon object
throws:
  NullPointerException - if key is null
since:
   1.4



getInsets
public static Insets getInsets(Object key)(Code)
Returns an Insets object from the defaults. If the value for key is not an Insets , null is returned.
Parameters:
  key - an Object specifying the Insets object the Insets object
throws:
  NullPointerException - if key is null



getInsets
public static Insets getInsets(Object key, Locale l)(Code)
Returns an Insets object from the defaults that is appropriate for the given locale. If the value for key is not an Insets , null is returned.
Parameters:
  key - an Object specifying the Insets object
Parameters:
  l - the Locale for which the object is desired; referto UIDefaults for details on how a null Locale is handled the Insets object
throws:
  NullPointerException - if key is null
since:
   1.4



getInstalledLookAndFeels
public static LookAndFeelInfo[] getInstalledLookAndFeels()(Code)
Returns an array of LookAndFeelInfo s representing the LookAndFeel implementations currently available. The LookAndFeelInfo objects can be used by 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 of creating numerous LookAndFeel objects, LookAndFeelInfo maintains the class name of the LookAndFeel class, not the actual LookAndFeel instance.

The following example illustrates setting the current look and feel from an instance of LookAndFeelInfo :

 UIManager.setLookAndFeel(info.getClassName());
 
an array of LookAndFeelInfo objects
See Also:   UIManager.setLookAndFeel



getInt
public static int getInt(Object key)(Code)
Returns an integer from the defaults. If the value for key is not an Integer , or does not exist, 0 is returned.
Parameters:
  key - an Object specifying the int the int
throws:
  NullPointerException - if key is null



getInt
public static int getInt(Object key, Locale l)(Code)
Returns an integer from the defaults that is appropriate for the given locale. If the value for key is not an Integer , or does not exist, 0 is returned.
Parameters:
  key - an Object specifying the int
Parameters:
  l - the Locale for which the int is desired; referto UIDefaults for details on how a null Locale is handled the int
throws:
  NullPointerException - if key is null
since:
   1.4



getLookAndFeel
public static LookAndFeel getLookAndFeel()(Code)
Returns the current look and feel or null. current look and feel, or null
See Also:   UIManager.setLookAndFeel



getLookAndFeelDefaults
public static UIDefaults getLookAndFeelDefaults()(Code)
Returns the UIDefaults from the current look and feel, that were obtained at the time the look and feel was installed.

In general, developers should use the UIDefaults returned from getDefaults() . As the current look and feel may expect certain values to exist, altering the UIDefaults returned from this method could have unexpected results. UIDefaults from the current look and feel
See Also:   UIManager.getDefaults
See Also:   UIManager.setLookAndFeel(LookAndFeel)
See Also:   LookAndFeel.getDefaults




getPropertyChangeListeners
public static PropertyChangeListener[] getPropertyChangeListeners()(Code)
Returns an array of all the PropertyChangeListeners added to this UIManager with addPropertyChangeListener(). all of the PropertyChangeListeners added or an emptyarray if no listeners have been added
since:
   1.4



getString
public static String getString(Object key)(Code)
Returns a string from the defaults. If the value for key is not a String , null is returned.
Parameters:
  key - an Object specifying the string the String
throws:
  NullPointerException - if key is null



getString
public static String getString(Object key, Locale l)(Code)
Returns a string from the defaults that is appropriate for the given locale. If the value for key is not a String , null is returned.
Parameters:
  key - an Object specifying the string
Parameters:
  l - the Locale for which the string is desired; referto UIDefaults for details on how a null Locale is handled the String
since:
   1.4
throws:
  NullPointerException - if key is null



getString
static String getString(Object key, Component c)(Code)
Returns a string from the defaults that is appropriate for the given locale. If the value for key is not a String , null is returned.
Parameters:
  key - an Object specifying the string
Parameters:
  c - Component used to determine the locale; null implies the default locale asreturned by Locale.getDefault() the String
throws:
  NullPointerException - if key is null



getSystemLookAndFeelClassName
public static String getSystemLookAndFeelClassName()(Code)
Returns the name of the LookAndFeel class that implements the native system look and feel if there is one, otherwise the name of the default cross platform LookAndFeel class. This value can be overriden by setting the swing.systemlaf system property. the String of the LookAndFeelclass
See Also:   UIManager.setLookAndFeel
See Also:   UIManager.getCrossPlatformLookAndFeelClassName



getUI
public static ComponentUI getUI(JComponent target)(Code)
Returns the appropriate ComponentUI implementation for target . Typically, this is a cover for getDefaults().getUI(target) . However, if an auxiliary look and feel has been installed, this first invokes getUI(target) on the multiplexing look and feel's defaults, and returns that value if it is non-null .
Parameters:
  target - the JComponent to return the ComponentUI for the ComponentUI object for target
throws:
  NullPointerException - if target is null
See Also:   UIDefaults.getUI



installLookAndFeel
public static void installLookAndFeel(LookAndFeelInfo info)(Code)
Adds the specified look and feel to the set of available look and feels. While this method allows a null info , it is strongly recommended that a non-null value be used.
Parameters:
  info - a LookAndFeelInfo object that names thelook and feel and identifies the class that implements it
See Also:   UIManager.setInstalledLookAndFeels



installLookAndFeel
public static void installLookAndFeel(String name, String className)(Code)
Adds the specified look and feel to the set of available look and feels. While this method does not check the arguments in any way, it is strongly recommended that non-null values be supplied.
Parameters:
  name - descriptive name of the look and feel
Parameters:
  className - name of the class that implements the look and feel
See Also:   UIManager.setInstalledLookAndFeels



put
public static Object put(Object key, Object value)(Code)
Stores an object in the developer defaults. This is a cover method for getDefaults().put(key, value) . This only effects the developer defaults, not the system or look and feel defaults.
Parameters:
  key - an Object specifying the retrieval key
Parameters:
  value - the Object to store; refer to UIDefaults for details on how null ishandled the Object returned by UIDefaults.put
throws:
  NullPointerException - if key is null
See Also:   UIDefaults.put



removeAuxiliaryLookAndFeel
public static boolean removeAuxiliaryLookAndFeel(LookAndFeel laf)(Code)
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. true if the LookAndFeel was removed from the list
See Also:   UIManager.removeAuxiliaryLookAndFeel
See Also:   UIManager.getAuxiliaryLookAndFeels
See Also:   UIManager.setLookAndFeel
See Also:   UIManager.getInstalledLookAndFeels




removePropertyChangeListener
public static void removePropertyChangeListener(PropertyChangeListener listener)(Code)
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:   java.beans.PropertyChangeSupport



setInstalledLookAndFeels
public static void setInstalledLookAndFeels(LookAndFeelInfo[] infos) throws SecurityException(Code)
Sets the set of available look and feels. While this method does not check to ensure all of the LookAndFeelInfos are non-null , it is strongly recommended that only non-null values are supplied in the infos array.
Parameters:
  infos - set of LookAndFeelInfo objects specifyingthe available look and feels
See Also:   UIManager.getInstalledLookAndFeels
throws:
  NullPointerException - if infos is null



setLookAndFeel
public static void setLookAndFeel(LookAndFeel newLookAndFeel) throws UnsupportedLookAndFeelException(Code)
Sets the current look and feel to newLookAndFeel . If the current look and feel is non-null uninitialize is invoked on it. If newLookAndFeel is non-null , initialize is invoked on it followed by getDefaults . The defaults returned from newLookAndFeel.getDefaults() replace those of the defaults from the previous look and feel. If the newLookAndFeel is null , the look and feel defaults are set to null .

A value of null can be used to set the look and feel to null . As the LookAndFeel is required for most of Swing to function, setting the LookAndFeel to null is strongly discouraged.

This is a JavaBeans bound property.
Parameters:
  newLookAndFeel - LookAndFeel to install
throws:
  UnsupportedLookAndFeelException - if newLookAndFeel is non-null and newLookAndFeel.isSupportedLookAndFeel() returns false
See Also:   UIManager.getLookAndFeel




setLookAndFeel
public static void setLookAndFeel(String className) throws ClassNotFoundException, InstantiationException, IllegalAccessException, UnsupportedLookAndFeelException(Code)
Loads the LookAndFeel specified by the given class name, using the current thread's context class loader, and passes it to setLookAndFeel(LookAndFeel) .
Parameters:
  className - a string specifying the name of the class that implementsthe look and feel
exception:
  ClassNotFoundException - if the LookAndFeelclass could not be found
exception:
  InstantiationException - if a new instance of the classcouldn't be created
exception:
  IllegalAccessException - if the class or initializer isn't accessible
exception:
  UnsupportedLookAndFeelException - iflnf.isSupportedLookAndFeel() is false
throws:
  ClassCastException - if className does not identifya class that extends LookAndFeel



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.