org.gjt.btools.gui.lookandfeel
Class LookAndFeelItem

java.lang.Object
  |
  +--org.gjt.btools.gui.lookandfeel.LookAndFeelItem

public class LookAndFeelItem
extends java.lang.Object

Provides information about a particular swing look and feel in a way that makes it suitable for use in menus. In particular, the toString() method returns a user-friendly description of the look and feel.

The static function getInstalledLookAndFeels will produce a list of all available look and feels.

See Also:
getInstalledLookAndFeels()

Constructor Summary
LookAndFeelItem(javax.swing.UIManager.LookAndFeelInfo info)
          Create a new look and feel item based on the given information.
 
Method Summary
 java.lang.String getClassName()
          Return the name of the Java look and feel class that this object represents.
static LookAndFeelItem[] getInstalledLookAndFeels()
          Returns a list of all available look and feels.
 boolean setLookAndFeel()
          Sets the current look and feel to the look and feel represented by this object.
 java.lang.String toString()
          Returns a user-friendly description of this look and feel.
static void updateLookAndFeel(java.awt.Frame topLevelContainer)
          Update the given container and all components contained therein to reflect the currently installed look and feel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LookAndFeelItem

public LookAndFeelItem(javax.swing.UIManager.LookAndFeelInfo info)
Create a new look and feel item based on the given information.

Parameters:
info - information about the look and feel which the new object will represent.
Method Detail

getClassName

public java.lang.String getClassName()
Return the name of the Java look and feel class that this object represents.

Returns:
the name of the corresponding Java look and feel class.

setLookAndFeel

public boolean setLookAndFeel()
Sets the current look and feel to the look and feel represented by this object. No error messages will be displayed to the user. Note that updateLookAndFeel must then be run on each top-level container.

Returns:
true if and only if the look and feel was successfully changed.
See Also:
updateLookAndFeel(java.awt.Frame)

updateLookAndFeel

public static void updateLookAndFeel(java.awt.Frame topLevelContainer)
Update the given container and all components contained therein to reflect the currently installed look and feel.

Parameters:
topLevelContainer - the container to update.

toString

public java.lang.String toString()
Returns a user-friendly description of this look and feel. This string can be used to identify this look and feel in a menu, combo box or similar component.

Overrides:
toString in class java.lang.Object
Returns:
a description of this look and feel.

getInstalledLookAndFeels

public static LookAndFeelItem[] getInstalledLookAndFeels()
Returns a list of all available look and feels.

Returns:
an array containing information about all available look and feels.


Copyright © 1998-2001, Ben Burton
This software is released under the GNU Public License.
For further information, or to submit a bug or other problem, please contact Ben Burton (bab@debian.org).