|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
java.lang.Objectjavax.swing.BorderFactory
public class BorderFactory
提供標準 Border 物件的處理器類別。在任何可能的地方,此處理器類別都將提供對已共享 Border 實例的參考。有關更多資訊和範例,請參閱 The Java Tutorial 中的 How to Use Borders 一節。
| 方法摘要 | |
|---|---|
static Border |
createBevelBorder(int type)
創建一個指定型別的斜面邊框,將元件當前背景色的較亮的色度用於高亮顯示,較暗的色度用於陰影。 |
static Border |
createBevelBorder(int type,
Color highlight,
Color shadow)
使用指定高亮顯示和陰影顯示方式來創建一個指定型別的斜面邊框。 |
static Border |
createBevelBorder(int type,
Color highlightOuter,
Color highlightInner,
Color shadowOuter,
Color shadowInner)
創建一個指定型別的斜面邊框,使用內部和外部高亮顯示區域及陰影區域的指定顏色。 |
static CompoundBorder |
createCompoundBorder()
創建一個具有 null 內部邊緣和 null 外部邊緣的合成邊框。 |
static CompoundBorder |
createCompoundBorder(Border outsideBorder,
Border insideBorder)
創建一個合成邊框,指定了用於外部和內部邊緣的 border 物件。 |
static Border |
createEmptyBorder()
創建一個不佔用空間的空邊框。 |
static Border |
createEmptyBorder(int top,
int left,
int bottom,
int right)
創建一個佔用空間但沒有繪製的空邊框,指定了頂線、底線、左邊框線和右邊框線的寬度。 |
static Border |
createEtchedBorder()
創建一個具有“浮雕化”外觀效果的邊框,將元件的當前背景色用於高亮顯示和陰影顯示。 |
static Border |
createEtchedBorder(Color highlight,
Color shadow)
使用指定的高亮顯示顏色和陰影顏色創建一個具有“浮雕化”外觀效果的邊框。 |
static Border |
createEtchedBorder(int type)
創建一個具有“浮雕化”外觀效果的邊框,將元件的當前背景色用於高亮顯示和陰影顯示。 |
static Border |
createEtchedBorder(int type,
Color highlight,
Color shadow)
使用指定的高亮顯示顏色和陰影顏色創建一個具有“浮雕化”外觀效果的邊框。 |
static Border |
createLineBorder(Color color)
創建一個具有指定顏色的線邊框。 |
static Border |
createLineBorder(Color color,
int thickness)
創建一個具有指定顏色和寬度的線邊框。 |
static Border |
createLoweredBevelBorder()
創建一個具有凹入斜面邊緣的邊框,將元件當前背景色的較亮的色度用於高亮顯示,較暗的色度用於陰影。 |
static MatteBorder |
createMatteBorder(int top,
int left,
int bottom,
int right,
Color color)
使用純色創建一個類似襯邊的邊框。 |
static MatteBorder |
createMatteBorder(int top,
int left,
int bottom,
int right,
Icon tileIcon)
創建一個由多層指定圖標組成的、類似襯邊的邊框。 |
static Border |
createRaisedBevelBorder()
創建一個具有凸出斜面邊緣的邊框,將元件當前背景色的較亮的色度用於高亮顯示,較暗的色度用於陰影。 |
static TitledBorder |
createTitledBorder(Border border)
創建一個空標題的新標題邊框,使其具有指定的邊框物件、預設的文本位置(位於頂線上)、預設的調整 (leading),以及預設的字體和文本顏色(由當前外觀確定)。 |
static TitledBorder |
createTitledBorder(Border border,
String title)
向現有邊框添加一個標題,使其具有預設的位置(位於頂線上)、預設的調整 (leading),以及預設的字體和文本顏色(由當前外觀確定)。 |
static TitledBorder |
createTitledBorder(Border border,
String title,
int titleJustification,
int titlePosition)
向現有邊框添加一個標題,使其具有指定的位置和預設字體和文本顏色(由當前外觀確定)。 |
static TitledBorder |
createTitledBorder(Border border,
String title,
int titleJustification,
int titlePosition,
Font titleFont)
向現有邊框添加一個標題,使其具有指定的位置和預設的文本顏色(由當前外觀確定)。 |
static TitledBorder |
createTitledBorder(Border border,
String title,
int titleJustification,
int titlePosition,
Font titleFont,
Color titleColor)
向現有邊框添加一個標題,使其具有指定的位置、字體和顏色。 |
static TitledBorder |
createTitledBorder(String title)
創建一個新標題邊框,使其具有指定的標題、預設的邊框型別(由當前外觀確定)、預設的文本位置(位於頂線上)、預設的調整 (leading),以及預設的字體和文本顏色(由當前外觀確定)。 |
| 從類別 java.lang.Object 繼承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 方法詳細資訊 |
|---|
public static Border createLineBorder(Color color)
color - 用於線條的 Color
Border 物件
public static Border createLineBorder(Color color,
int thickness)
createMatteBorder(int,int,int,int,Color)。
color - 用於線條的顏色 Colorthickness - 指定寬度的整數,以像素為單位
Border 物件public static Border createRaisedBevelBorder()
Border 物件public static Border createLoweredBevelBorder()
Border 物件public static Border createBevelBorder(int type)
type - 指定 BevelBorder.LOWERED 或 BevelBorder.RAISED 的整數
Border 物件
public static Border createBevelBorder(int type,
Color highlight,
Color shadow)
type - 指定 BevelBorder.LOWERED 或 BevelBorder.RAISED 的整數highlight - 用於高亮顯示的 Color 物件shadow - 用於陰影的 Color 物件
Border 物件
public static Border createBevelBorder(int type,
Color highlightOuter,
Color highlightInner,
Color shadowOuter,
Color shadowInner)
註:對於凹入斜面邊框,交換陰影內部和外部顏色。
type - 指定 BevelBorder.LOWERED 或 BevelBorder.RAISED 的整數highlightOuter - 用於高亮顯示區域的外邊緣的 Color 物件highlightInner - 用於高亮顯示區域的內邊緣的 Color 物件shadowOuter - 用於陰影區域的外邊緣的 Color 物件shadowInner - 用於陰影區域的內邊緣的 Color 物件
Border 物件public static Border createEtchedBorder()
Border 物件
public static Border createEtchedBorder(Color highlight,
Color shadow)
highlight - 用於邊框高亮顯示的 Color 物件shadow - 用於邊框陰影的 Color 物件
Border 物件public static Border createEtchedBorder(int type)
type - EtchedBorder.RAISED 或 EtchedBorder.LOWERED 之一
Border 物件
IllegalArgumentException - 如果型別既不是 EtchedBorder.RAISED 也不是 EtchedBorder.LOWERED
public static Border createEtchedBorder(int type,
Color highlight,
Color shadow)
type - EtchedBorder.RAISED 或 EtchedBorder.LOWERED 之一highlight - 用於邊框高亮顯示的 Color 物件shadow - 用於邊框陰影的 Color 物件
Border 物件public static TitledBorder createTitledBorder(String title)
title - 套件含標題文本的 String
TitledBorder 物件public static TitledBorder createTitledBorder(Border border)
border - 向其添加標題的 Border 物件;如果該參數為 null,則 Border 由當前外觀確定。
TitledBorder 物件
public static TitledBorder createTitledBorder(Border border,
String title)
border - 向其添加標題的 Border 物件title - 套件含標題文本的 String
TitledBorder 物件
public static TitledBorder createTitledBorder(Border border,
String title,
int titleJustification,
int titlePosition)
border - 向其添加標題的 Border 物件title - 套件含標題文本的 StringtitleJustification - 指定標題調整的整數,該值為以下值之一:
TitledBorder.LEFT
TitledBorder.CENTER
TitledBorder.RIGHT
TitledBorder.LEADING
TitledBorder.TRAILING
TitledBorder.DEFAULT_JUSTIFICATION (leading)
titlePosition - 指示文本相對於邊框的縱向位置的整數,它為以下值之一:
TitledBorder.ABOVE_TOP
TitledBorder.TOP(位於頂線上)
TitledBorder.BELOW_TOP
TitledBorder.ABOVE_BOTTOM
TitledBorder.BOTTOM(位於底線上)
TitledBorder.BELOW_BOTTOM
TitledBorder.DEFAULT_POSITION(頂部)
TitledBorder 物件
public static TitledBorder createTitledBorder(Border border,
String title,
int titleJustification,
int titlePosition,
Font titleFont)
border - 向其添加標題的 Border 物件title - 套件含標題文本的 StringtitleJustification - 指定標題調整的整數,該值為以下值之一:
TitledBorder.LEFT
TitledBorder.CENTER
TitledBorder.RIGHT
TitledBorder.LEADING
TitledBorder.TRAILING
TitledBorder.DEFAULT_JUSTIFICATION (leading)
titlePosition - 指示文本相對於邊框的縱向位置的整數,它為以下值之一:
TitledBorder.ABOVE_TOP
TitledBorder.TOP(位於頂線上)
TitledBorder.BELOW_TOP
TitledBorder.ABOVE_BOTTOM
TitledBorder.BOTTOM(位於底線上)
TitledBorder.BELOW_BOTTOM
TitledBorder.DEFAULT_POSITION(頂部)
titleFont - 指定標題字體的 Font 物件
public static TitledBorder createTitledBorder(Border border,
String title,
int titleJustification,
int titlePosition,
Font titleFont,
Color titleColor)
border - 向其添加標題的 Border 物件title - 套件含標題文本的 StringtitleJustification - 指定標題調整的整數,該值為以下值之一:
TitledBorder.LEFT
TitledBorder.CENTER
TitledBorder.RIGHT
TitledBorder.LEADING
TitledBorder.TRAILING
TitledBorder.DEFAULT_JUSTIFICATION (leading)
titlePosition - 指示文本相對於邊框的縱向位置的整數,它為以下值之一:
TitledBorder.ABOVE_TOP
TitledBorder.TOP(位於頂線上)
TitledBorder.BELOW_TOP
TitledBorder.ABOVE_BOTTOM
TitledBorder.BOTTOM(位於底線上)
TitledBorder.BELOW_BOTTOM
TitledBorder.DEFAULT_POSITION(頂部)
titleFont - 指定標題字體的 Font 物件titleColor - 指定標題顏色的 Color 物件
TitledBorder 物件public static Border createEmptyBorder()
Border 物件
public static Border createEmptyBorder(int top,
int left,
int bottom,
int right)
top - 指定頂線寬度的整數,以像素為單位left - 指定左邊框線寬度的整數,以像素為單位bottom - 指定底線寬度的整數,以像素為單位right - 指定右邊框線寬度的整數,以像素為單位
Border 物件public static CompoundBorder createCompoundBorder()
null 內部邊緣和 null 外部邊緣的合成邊框。
CompoundBorder 物件
public static CompoundBorder createCompoundBorder(Border outsideBorder,
Border insideBorder)
outsideBorder - 用於合成邊框的外部邊緣的 Border 物件insideBorder - 用於合成邊框的內部邊緣的 Border 物件
CompoundBorder 物件
public static MatteBorder createMatteBorder(int top,
int left,
int bottom,
int right,
Color color)
top - 指定頂線寬度的整數,以像素為單位left - 指定左邊框線寬度的整數,以像素為單位right - 指定右邊框線寬度的整數,以像素為單位bottom - 指定底線寬度的整數,以像素為單位color - 用於邊框的 Color
MatteBorder 物件
public static MatteBorder createMatteBorder(int top,
int left,
int bottom,
int right,
Icon tileIcon)
註:
如果無法載入該圖標,則邊框區域被繪製為灰色。
top - 指定頂線寬度的整數,以像素為單位left - 指定左邊框線寬度的整數,以像素為單位right - 指定右邊框線寬度的整數,以像素為單位bottom - 指定底線寬度的整數,以像素為單位tileIcon - 用於邊框平鋪顯示的 Icon 物件
MatteBorder 物件
|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
版權所有 2008 Sun Microsystems, Inc. 保留所有權利。請遵守GNU General Public License, version 2 only。