|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
java.lang.Objectjavax.swing.plaf.metal.MetalTheme
javax.swing.plaf.metal.DefaultMetalTheme
public class DefaultMetalTheme
提供 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。
MetalLookAndFeel,
MetalLookAndFeel.setCurrentTheme(javax.swing.plaf.metal.MetalTheme)| 建構子摘要 | |
|---|---|
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 |
| 建構子詳細資訊 |
|---|
public DefaultMetalTheme()
DefaultMetalTheme 的一個實例。
| 方法詳細資訊 |
|---|
public String getName()
"Steel"。
MetalTheme 中的 getNameprotected ColorUIResource getPrimary1()
MetalTheme 中的 getPrimary1protected ColorUIResource getPrimary2()
MetalTheme 中的 getPrimary2protected ColorUIResource getPrimary3()
MetalTheme 中的 getPrimary3protected ColorUIResource getSecondary1()
MetalTheme 中的 getSecondary1protected ColorUIResource getSecondary2()
MetalTheme 中的 getSecondary2protected ColorUIResource getSecondary3()
MetalTheme 中的 getSecondary3public FontUIResource getControlTextFont()
MetalTheme 中的 getControlTextFontpublic FontUIResource getSystemTextFont()
MetalTheme 中的 getSystemTextFontpublic FontUIResource getUserTextFont()
MetalTheme 中的 getUserTextFontpublic FontUIResource getMenuTextFont()
MetalTheme 中的 getMenuTextFontpublic FontUIResource getWindowTitleFont()
MetalTheme 中的 getWindowTitleFontpublic FontUIResource getSubTextFont()
MetalTheme 中的 getSubTextFont
|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
版權所有 2008 Sun Microsystems, Inc. 保留所有權利。請遵守GNU General Public License, version 2 only。