- java.lang.Object
-
- javax.swing.plaf.metal.MetalTheme
-
- javax.swing.plaf.metal.DefaultMetalTheme
-
- Direct Known Subclasses:
- OceanTheme
public class DefaultMetalTheme extends MetalTheme
A concrete implementation ofMetalTheme
providing the original look of the Java Look and Feel, code-named "Steel". Refer toMetalLookAndFeel.setCurrentTheme(javax.swing.plaf.metal.MetalTheme)
for details on changing the default theme.All colors returned by
DefaultMetalTheme
are completely opaque.Font Style
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:- Set the system property
swing.boldMetal
tofalse
. For example,java -Dswing.boldMetal=false MyApp
. - Set the defaults property
swing.boldMetal
toBoolean.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-installMetalLookAndFeel
, 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 seeXMLEncoder
.
-
-
Constructor Summary
Constructors Constructor and Description DefaultMetalTheme()
Creates and returns an instance ofDefaultMetalTheme
.
-
Method Summary
Methods Modifier and Type Method and Description FontUIResource
getControlTextFont()
Returns the control text font.FontUIResource
getMenuTextFont()
Returns the menu text font.String
getName()
Returns the name of this theme.protected ColorUIResource
getPrimary1()
Returns the primary 1 color.protected ColorUIResource
getPrimary2()
Returns the primary 2 color.protected ColorUIResource
getPrimary3()
Returns the primary 3 color.protected ColorUIResource
getSecondary1()
Returns the secondary 1 color.protected ColorUIResource
getSecondary2()
Returns the secondary 2 color.protected ColorUIResource
getSecondary3()
Returns the secondary 3 color.FontUIResource
getSubTextFont()
Returns the sub-text font.FontUIResource
getSystemTextFont()
Returns the system text font.FontUIResource
getUserTextFont()
Returns the user text font.FontUIResource
getWindowTitleFont()
Returns the window title font.-
Methods inherited from class javax.swing.plaf.metal.MetalTheme
addCustomEntriesToTable, getAcceleratorForeground, getAcceleratorSelectedForeground, getBlack, getControl, getControlDarkShadow, getControlDisabled, getControlHighlight, getControlInfo, getControlShadow, getControlTextColor, getDesktopColor, getFocusColor, getHighlightedTextColor, getInactiveControlTextColor, getInactiveSystemTextColor, getMenuBackground, getMenuDisabledForeground, getMenuForeground, getMenuSelectedBackground, getMenuSelectedForeground, getPrimaryControl, getPrimaryControlDarkShadow, getPrimaryControlHighlight, getPrimaryControlInfo, getPrimaryControlShadow, getSeparatorBackground, getSeparatorForeground, getSystemTextColor, getTextHighlightColor, getUserTextColor, getWhite, getWindowBackground, getWindowTitleBackground, getWindowTitleForeground, getWindowTitleInactiveBackground, getWindowTitleInactiveForeground
-
-
-
-
Constructor Detail
-
DefaultMetalTheme
public DefaultMetalTheme()
Creates and returns an instance ofDefaultMetalTheme
.
-
-
Method Detail
-
getName
public String getName()
Returns the name of this theme. This returns"Steel"
.- Specified by:
getName
in classMetalTheme
- Returns:
- the name of this theme.
-
getPrimary1
protected ColorUIResource getPrimary1()
Returns the primary 1 color. This returns a color with rgb values of 102, 102, and 153, respectively.- Specified by:
getPrimary1
in classMetalTheme
- Returns:
- the primary 1 color
-
getPrimary2
protected ColorUIResource getPrimary2()
Returns the primary 2 color. This returns a color with rgb values of 153, 153, 204, respectively.- Specified by:
getPrimary2
in classMetalTheme
- Returns:
- the primary 2 color
-
getPrimary3
protected ColorUIResource getPrimary3()
Returns the primary 3 color. This returns a color with rgb values 204, 204, 255, respectively.- Specified by:
getPrimary3
in classMetalTheme
- Returns:
- the primary 3 color
-
getSecondary1
protected ColorUIResource getSecondary1()
Returns the secondary 1 color. This returns a color with rgb values 102, 102, and 102, respectively.- Specified by:
getSecondary1
in classMetalTheme
- Returns:
- the secondary 1 color
-
getSecondary2
protected ColorUIResource getSecondary2()
Returns the secondary 2 color. This returns a color with rgb values 153, 153, and 153, respectively.- Specified by:
getSecondary2
in classMetalTheme
- Returns:
- the secondary 2 color
-
getSecondary3
protected ColorUIResource getSecondary3()
Returns the secondary 3 color. This returns a color with rgb values 204, 204, and 204, respectively.- Specified by:
getSecondary3
in classMetalTheme
- Returns:
- the secondary 3 color
-
getControlTextFont
public FontUIResource getControlTextFont()
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.- Specified by:
getControlTextFont
in classMetalTheme
- Returns:
- the control text font
-
getSystemTextFont
public FontUIResource getSystemTextFont()
Returns the system text font. This returns Dialog, 12pt, plain.- Specified by:
getSystemTextFont
in classMetalTheme
- Returns:
- the sytem text font
-
getUserTextFont
public FontUIResource getUserTextFont()
Returns the user text font. This returns Dialog, 12pt, plain.- Specified by:
getUserTextFont
in classMetalTheme
- Returns:
- the user text font
-
getMenuTextFont
public FontUIResource getMenuTextFont()
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.- Specified by:
getMenuTextFont
in classMetalTheme
- Returns:
- the menu text font
-
getWindowTitleFont
public FontUIResource getWindowTitleFont()
Returns the window title font. This returns Dialog, 12pt, bold.- Specified by:
getWindowTitleFont
in classMetalTheme
- Returns:
- the window title font
-
getSubTextFont
public FontUIResource getSubTextFont()
Returns the sub-text font. This returns Dialog, 10pt, plain.- Specified by:
getSubTextFont
in classMetalTheme
- Returns:
- the sub-text font
-
-
Nederlandse vertaling
U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.
Bij voorbaat dank.
Document heeft de 11/06/2005 gemaakt, de laatste keer de 04/03/2020 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/java-api-rf-javax/swing/plaf/metal/defaultmetaltheme.html/.html
De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.
Referenties
Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur Deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.