public class DefaultMetalTheme extends MetalTheme
MetalTheme提供了Java外观和感觉,代号为“钢”的原貌。
有关更改默认主题的详细信息,请参阅MetalLookAndFeel.setCurrentTheme(javax.swing.plaf.metal.MetalTheme) 。
DefaultMetalTheme返回的所有颜色都是完全不透明的。
DefaultMetalTheme为许多控件使用粗体字体。
要使所有控件(内部框架标题栏和客户端装饰的框架标题栏除外)使用纯字体,您可以执行以下操作之一:
swing.boldMetal设置为false 。 例如, java -Dswing.boldMetal=false MyApp 。 swing.boldMetal设置为Boolean.FALSE 。 例如: UIManager.put("swing.boldMetal", Boolean.FALSE); swing.boldMetal (如果设置)优先于同名的系统属性。
设置此defaults属性后,您需要重新安装MetalLookAndFeel ,以及更新任何先前创建的小部件的UI。
否则结果是未定义的。
以下说明如何做到这一点:
// 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);
警告:此类的序列化对象与将来的Swing版本不兼容。 当前的序列化支持适用于运行相同版本的Swing的应用程序之间的短期存储或RMI。 从1.4开始,对所有JavaBeans的长期存储的支持已经添加到java.beans包中。 请参阅XMLEncoder 。
| Constructor and Description |
|---|
DefaultMetalTheme()
创建并返回一个
DefaultMetalTheme的实例。
|
| Modifier and Type | Method and Description |
|---|---|
FontUIResource |
getControlTextFont()
返回控件文本字体。
|
FontUIResource |
getMenuTextFont()
返回菜单文本字体。
|
String |
getName()
返回此主题的名称。
|
protected ColorUIResource |
getPrimary1()
返回主要1颜色。
|
protected ColorUIResource |
getPrimary2()
返回主2颜色。
|
protected ColorUIResource |
getPrimary3()
返回主3颜色。
|
protected ColorUIResource |
getSecondary1()
返回辅助1颜色。
|
protected ColorUIResource |
getSecondary2()
返回辅助2颜色。
|
protected ColorUIResource |
getSecondary3()
返回辅助3颜色。
|
FontUIResource |
getSubTextFont()
返回子文本字体。
|
FontUIResource |
getSystemTextFont()
返回系统文本字体。
|
FontUIResource |
getUserTextFont()
返回用户文本字体。
|
FontUIResource |
getWindowTitleFont()
返回窗口标题字体。
|
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, getWindowTitleInactiveForegroundpublic String getName()
"Steel" 。
getName在
MetalTheme
protected ColorUIResource getPrimary1()
getPrimary1在
MetalTheme
protected ColorUIResource getPrimary2()
getPrimary2在
MetalTheme
protected ColorUIResource getPrimary3()
getPrimary3在
MetalTheme
protected ColorUIResource getSecondary1()
getSecondary1在
MetalTheme
protected ColorUIResource getSecondary2()
getSecondary2在
MetalTheme
protected ColorUIResource getSecondary3()
getSecondary3在
MetalTheme
public FontUIResource getControlTextFont()
getControlTextFont在
MetalTheme
public FontUIResource getSystemTextFont()
getSystemTextFont在
MetalTheme
public FontUIResource getUserTextFont()
getUserTextFont在
MetalTheme
public FontUIResource getMenuTextFont()
getMenuTextFont在
MetalTheme
public FontUIResource getWindowTitleFont()
getWindowTitleFont在
MetalTheme
public FontUIResource getSubTextFont()
getSubTextFont在
MetalTheme
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.