java.lang.Object
javax.swing.plaf.metal.MetalTheme
javax.swing.plaf.metal.DefaultMetalTheme
- 已知子类:
OceanTheme
MetalTheme 的具体实现提供了 Java 外观的原始外观,代号为“Steel”。有关更改默认主题的详细信息,请参阅 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 如果设置,则优先于同名的系统属性。设置此默认属性后,您需要重新安装 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);
Warning: 此类的序列化对象将与未来的 Swing 版本不兼容。当前的序列化支持适用于运行相同版本 Swing 的应用程序之间的短期存储或 RMI。从 1.4 开始,对所有 JavaBeans 的长期存储的支持已添加到 java.beans 包中。请参阅 XMLEncoder 。
- 参见:
-
构造方法总结
构造方法 -
方法总结
修饰符和类型方法描述返回控件文本字体。返回菜单文本字体。getName()返回此主题的名称。protected ColorUIResource返回原色 1。protected ColorUIResource返回主要的 2 颜色。protected ColorUIResource返回主要的 3 颜色。protected ColorUIResource返回辅助 1 颜色。protected ColorUIResource返回辅助 2 颜色。protected ColorUIResource返回辅助 3 颜色。返回子文本字体。返回系统文本字体。返回用户文本字体。返回窗口标题字体。在类 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
-
构造方法详细信息
-
DefaultMetalTheme
public DefaultMetalTheme()创建并返回DefaultMetalTheme的实例。
-
-
方法详情
-
getName
返回此主题的名称。这将返回"Steel"。- 指定者:
getName在类MetalTheme中- 返回:
- 这个主题的名称。
-
getPrimary1
返回原色 1。这将返回 rgb 值分别为 102、102 和 153 的颜色。- 指定者:
getPrimary1在类MetalTheme中- 返回:
- 原色 1
-
getPrimary2
返回主要的 2 颜色。这将返回 rgb 值分别为 153、153、204 的颜色。- 指定者:
getPrimary2在类MetalTheme中- 返回:
- 初级 2 颜色
-
getPrimary3
返回主要的 3 颜色。这将返回 rgb 值分别为 204、204、255 的颜色。- 指定者:
getPrimary3在类MetalTheme中- 返回:
- 原三色
-
getSecondary1
返回辅助 1 颜色。这将返回 rgb 值分别为 102、102 和 102 的颜色。- 指定者:
getSecondary1在类MetalTheme中- 返回:
- 辅助 1 颜色
-
getSecondary2
返回辅助 2 颜色。这将返回 rgb 值分别为 153、153 和 153 的颜色。- 指定者:
getSecondary2在类MetalTheme中- 返回:
- 二级 2 颜色
-
getSecondary3
返回辅助 3 颜色。这将返回 rgb 值分别为 204、204 和 204 的颜色。- 指定者:
getSecondary3在类MetalTheme中- 返回:
- 二级 3 颜色
-
getControlTextFont
返回控件文本字体。这将返回 Dialog,12pt。如果按照 字体样式 中的描述启用了普通字体,则字体样式为普通字体。否则字体样式为粗体。- 指定者:
getControlTextFont在类MetalTheme中- 返回:
- 控制文本字体
-
getSystemTextFont
返回系统文本字体。这将返回 Dialog,12pt,plain。- 指定者:
getSystemTextFont在类MetalTheme中- 返回:
- 系统文字字体
-
getUserTextFont
返回用户文本字体。这将返回 Dialog,12pt,plain。- 指定者:
getUserTextFont在类MetalTheme中- 返回:
- 用户文字字体
-
getMenuTextFont
返回菜单文本字体。这将返回 Dialog,12pt。如果按照 字体样式 中的描述启用了普通字体,则字体样式为普通字体。否则字体样式为粗体。- 指定者:
getMenuTextFont在类MetalTheme中- 返回:
- 菜单文字字体
-
getWindowTitleFont
返回窗口标题字体。这将返回 Dialog,12pt,粗体。- 指定者:
getWindowTitleFont在类MetalTheme中- 返回:
- 窗口标题字体
-
getSubTextFont
返回子文本字体。这将返回 Dialog,10pt,plain。- 指定者:
getSubTextFont在类MetalTheme中- 返回:
- 子文本字体
-