|
JavaTM 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 Platform Standard Ed. 6 |
|||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策。