java.lang.Object | ||
↳ | javax.swing.plaf.metal.MetalTheme | |
↳ | javax.swing.plaf.metal.DefaultMetalTheme |
![]() |
A concrete implementation of MetalTheme
providing
the original look of the Java Look and Feel, code-named "Steel". Refer
to setCurrentTheme(MetalTheme)
for details on changing
the default theme.
All colors returned by DefaultMetalTheme
are completely
opaque.
DefaultMetalTheme
uses bold fonts for many controls. To make all
controls (with the exception of the internal frame title bars and
client decorated frame title bars) use plain fonts you can do either of
the following:
swing.boldMetal
to
false
. For example,
java -Dswing.boldMetal=false MyApp
.
swing.boldMetal
to
Boolean.FALSE
. For example:
UIManager.put("swing.boldMetal", Boolean.FALSE);
swing.boldMetal
, if set,
takes precendence over the system property of the same name. After
setting this defaults property you need to re-install
MetalLookAndFeel
, as well as update the UI
of any previously created widgets. Otherwise the results are undefined.
The following illustrates how to do this:
// turn off bold fonts UIManager.put("swing.boldMetal", Boolean.FALSE); // re-install the Metal Look and Feel UIManager.setLookAndFeel(new MetalLookAndFeel()); // Update the ComponentUIs for all Components. This // needs to be invoked for all windows. SwingUtilities.updateComponentTreeUI(rootComponent);
Warning:
Serialized objects of this class will not be compatible with
future Swing releases. The current serialization support is
appropriate for short term storage or RMI between applications running
the same version of Swing. As of 1.4, support for long term storage
of all JavaBeansTM
has been added to the java.beans
package.
Please see XMLEncoder
.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates and returns an instance of
DefaultMetalTheme . |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns the control text font.
| |||||||||||
Returns the menu text font.
| |||||||||||
Returns the name of this theme.
| |||||||||||
Returns the sub-text font.
| |||||||||||
Returns the system text font.
| |||||||||||
Returns the user text font.
| |||||||||||
Returns the window title font.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns the primary 1 color.
| |||||||||||
Returns the primary 2 color.
| |||||||||||
Returns the primary 3 color.
| |||||||||||
Returns the secondary 1 color.
| |||||||||||
Returns the secondary 2 color.
| |||||||||||
Returns the secondary 3 color.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Creates and returns an instance of DefaultMetalTheme
.
Returns the control text font. This returns Dialog, 12pt. If plain fonts have been enabled as described in font style, the font style is plain. Otherwise the font style is bold.
Returns the menu text font. This returns Dialog, 12pt. If plain fonts have been enabled as described in font style, the font style is plain. Otherwise the font style is bold.
Returns the name of this theme. This returns "Steel"
.
Returns the sub-text font. This returns Dialog, 10pt, plain.
Returns the system text font. This returns Dialog, 12pt, plain.
Returns the user text font. This returns Dialog, 12pt, plain.
Returns the window title font. This returns Dialog, 12pt, bold.
Returns the primary 1 color. This returns a color with rgb values of 102, 102, and 153, respectively.
Returns the primary 2 color. This returns a color with rgb values of 153, 153, 204, respectively.
Returns the primary 3 color. This returns a color with rgb values 204, 204, 255, respectively.
Returns the secondary 1 color. This returns a color with rgb values 102, 102, and 102, respectively.
Returns the secondary 2 color. This returns a color with rgb values 153, 153, and 153, respectively.
Returns the secondary 3 color. This returns a color with rgb values 204, 204, and 204, respectively.