| |||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |
javax.swing.plaf.metal
类 DefaultMetalTheme
java.lang.Object javax.swing.plaf.metal.MetalTheme javax.swing.plaf.metal.DefaultMetalTheme
- 直接已知子类:
- OceanTheme
public class DefaultMetalTheme
- extends MetalTheme
提供 Java 外观原型的 MetalTheme
的一个具体实现,代码名称为“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);
警告:此类的序列化对象与以后的 Swing 版本不兼容。当前序列化支持适用于短期存储或运行相同 Swing 版本的应用程序之间的 RMI。从 1.4 版本开始,已在 java.beans
包中添加了支持所有 JavaBeansTM 长期存储的功能。请参见 XMLEncoder
。
构造方法摘要 | |
---|---|
DefaultMetalTheme() 创建并返回 DefaultMetalTheme 的一个实例。 |
方法摘要 | |
---|---|
FontUIResource | getControlTextFont() 返回控件文本字体。 |
FontUIResource | getMenuTextFont() 返回菜单文本字体。 |
String | getName() 返回此主题的名称。 |
protected ColorUIResource | getPrimary1() 返回 primary 1 颜色。 |
protected ColorUIResource | getPrimary2() 返回 primary 2 颜色。 |
protected ColorUIResource | getPrimary3() 返回 primary 3 颜色。 |
protected ColorUIResource | getSecondary1() 返回 secondary 1 颜色。 |
protected ColorUIResource | getSecondary2() 返回 secondary 2 颜色。 |
protected ColorUIResource | getSecondary3() 返回 secondary 3 颜色。 |
FontUIResource | getSubTextFont() 返回子文本字体。 |
FontUIResource | getSystemTextFont() 返回系统文本字体。 |
FontUIResource | getUserTextFont() 返回用户文本字体。 |
FontUIResource | getWindowTitleFont() 返回窗口标题字体。 |
从类 java.lang.Object 继承的方法 |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
构造方法详细信息 |
---|
DefaultMetalTheme
public DefaultMetalTheme()
- 创建并返回
DefaultMetalTheme
的一个实例。
方法详细信息 |
---|
getName
public String getName()
- 返回此主题的名称。此方法返回
"Steel"
。 - 指定者:
- 类
MetalTheme
中的getName
- 返回:
- 此主题的名称
getPrimary1
protected ColorUIResource getPrimary1()
- 返回 primary 1 颜色。此方法返回 rgb 值分别为 102、102 和 153 的颜色。
- 指定者:
- 类
MetalTheme
中的getPrimary1
- 返回:
- primary 1 颜色
getPrimary2
protected ColorUIResource getPrimary2()
- 返回 primary 2 颜色。此方法返回 rgb 值分别为 153、153、204 的颜色。
- 指定者:
- 类
MetalTheme
中的getPrimary2
- 返回:
- primary 2 颜色
getPrimary3
protected ColorUIResource getPrimary3()
- 返回 primary 3 颜色。此方法返回 rgb 值分别为 204、204、255 的颜色。
- 指定者:
- 类
MetalTheme
中的getPrimary3
- 返回:
- primary 3 颜色
getSecondary1
protected ColorUIResource getSecondary1()
- 返回 secondary 1 颜色。此方法返回 rgb 值分别为 102、102 和 102 的颜色。
- 指定者:
- 类
MetalTheme
中的getSecondary1
- 返回:
- secondary 1 颜色
getSecondary2
protected ColorUIResource getSecondary2()
- 返回 secondary 2 颜色。此方法返回 rgb 值分别为 153、153 和 153 的颜色。
- 指定者:
- 类
MetalTheme
中的getSecondary2
- 返回:
- secondary 2 颜色