All Packages Class Hierarchy This Package Previous Next Index
Class com.sun.java.swing.UIManager
java.lang.Object
|
+----com.sun.java.swing.UIManager
- public class UIManager
- extends Object
The UIManager is responsible for managing the list of installed
UIFactory classes, and for determining which of these is the default.
-
UIManager()
-
-
addUIChangeListener(Window)
- Add a Window which will be notified when the default UI changes.
-
deinstallUIFactory(String)
- Deinstalls a UI factory from the persistent list of available UI
factories.
-
getAuxiliaryFactories()
- Return the list of auxiliary factories (can be null).
-
getDefaultFactory()
- Returns the current default UI factory.
-
getInstalledUIFactoryList()
- Returns an Enumeration of the class names of all the UI factories
which are currently installed.
-
getUI(String, String, JComponent)
- Obtain a UI from the default factory.
-
getUIFactory(String)
- Gets a UI factory by class name.
-
installUIFactory(String)
- Installs a UI factory.
-
removeUIChangeListener(Window)
- Remove a Window from the list of UI change notification recipients.
-
setInstalledUIFactoryList(String[])
- Sets the list of available UI factories.
-
setUIFactory(String, Container)
- Sets the default UI factory, and optionally resets all of the
child components' UI objects in a Container.
-
setUIFactory(UIFactory, Container)
- Sets the default UI factory, and optionally resets all of the
child components' UI objects in a Container.
-
setUIFactory(UIFactory, Container, boolean)
- Sets the default UI factory, optionally resets all of the
child components' UI objects in a Container, and optionally
saves the default UI factory property.
UIManager
public UIManager()
getAuxiliaryFactories
public static UIFactory[] getAuxiliaryFactories()
- Return the list of auxiliary factories (can be null).
getDefaultFactory
public static UIFactory getDefaultFactory()
- Returns the current default UI factory.
getUIFactory
public static UIFactory getUIFactory(String factoryClassName) throws ClassNotFoundException
- Gets a UI factory by class name. If this is the first reference
to this UI factory, it is loaded and added to the list of available
UI factories.
- Parameters:
- factoryClassName - the class name of the new UI factory,
such as "com.foo.Bar".
- Throws: ClassNotFoundException
- if the specified class cannot be found.
getInstalledUIFactoryList
public static synchronized Enumeration getInstalledUIFactoryList()
- Returns an Enumeration of the class names of all the UI factories
which are currently installed.
setUIFactory
public static void setUIFactory(String factoryClassName,
Container top) throws ClassNotFoundException, SecurityException
- Sets the default UI factory, and optionally resets all of the
child components' UI objects in a Container.
- Parameters:
- factoryClassName - the class name of the new UI factory,
such as "com.foo.Bar".
- top - a Container whose UI object and its
children's UI objects should be replaced
with UI objects from the new factory.
Use null if no Container needs resetting.
- Throws: ClassNotFoundException
- if the specified class cannot be found.
- Throws: SecurityException
- if a UI factory list has been set.
- See Also:
- setInstalledUIFactoryList
setUIFactory
public static void setUIFactory(UIFactory factory,
Container top) throws SecurityException
- Sets the default UI factory, and optionally resets all of the
child components' UI objects in a Container.
- Parameters:
- factory - the new UI factory.
- top - a Container whose UI object and its
children's UI objects should be replaced
with UI objects from the new factory.
Use null if no Container needs resetting.
- Throws: SecurityException
- if a UI factory list has been set.
- See Also:
- setInstalledUIFactoryList
setUIFactory
public static void setUIFactory(UIFactory factory,
Container top,
boolean persists) throws SecurityException
- Sets the default UI factory, optionally resets all of the
child components' UI objects in a Container, and optionally
saves the default UI factory property.
- Parameters:
- factory - the new UI factory.
- top - a Container whose UI object and its
children's UI objects should be replaced
with UI objects from the new factory.
Use null if no Container needs resetting.
- persists - save the default UI factory in the UIManager's
properties file.
- Throws: SecurityException
- if a UI factory list has been set.
- See Also:
- setInstalledUIFactoryList
setInstalledUIFactoryList
public static synchronized void setInstalledUIFactoryList(String factoryClassList[]) throws ClassNotFoundException
- Sets the list of available UI factories. This method should only be used
by applications which wish to restrict the list of UI factories they support.
Once this method is called, new UI factories cannot be set or
installed except by another call to this method.
- Parameters:
- factories - the list of supported UI factories, such as
"com.sun.java.swing.basic.BasicFactory".
- Throws: ClassNotFoundException
- if any of the specified classes cannot
be found.
installUIFactory
public static synchronized void installUIFactory(String factoryClassName) throws ClassNotFoundException, SecurityException
- Installs a UI factory. It is loaded and added to the list of
available UI factories. Unlike getUIFactory(), this installation
persists across VM invocations.
- Parameters:
- factoryClassName - the class name of the new UI factory,
such as "com.foo.Bar".
- Throws: ClassNotFoundException
- if the specified class cannot be found.
- Throws: SecurityException
- if a UI factory list has been set.
- See Also:
- setInstalledUIFactoryList
deinstallUIFactory
public static synchronized void deinstallUIFactory(String factoryClassName) throws ClassNotFoundException
- Deinstalls a UI factory from the persistent list of available UI
factories.
- Parameters:
- factoryClassName - the class name of the UI factory,
such as "com.foo.Bar".
- Throws: ClassNotFoundException
- if the specified class cannot be found.
addUIChangeListener
public static void addUIChangeListener(Window w)
- Add a Window which will be notified when the default UI changes.
Implementing UIManager.UpdateUI will cause the updateUI() method
to be called when the default UI changes.
- Parameters:
- w - the Window to be notified.
removeUIChangeListener
public static void removeUIChangeListener(Window w)
- Remove a Window from the list of UI change notification recipients.
- Parameters:
- w - the Window to be removed.
getUI
public static ComponentUI getUI(String widgetName,
String defaultClassName,
JComponent target)
- Obtain a UI from the default factory.
- Parameters:
- widgetName - the name of the UI to get from the default factory.
- defaultClassName - the default class to use if the default factory
does not support widgetName.
- target - the target component.
All Packages Class Hierarchy This Package Previous Next Index