©
本文档使用
php.cn手册 发布
|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
上一个类 下一个类 | 框架 无框架 | |||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |
1 2 3 |
|
1 |
|
该类实现在指定位置以指定对齐方式显示字符串标题的任意边框。
如果构造方法中未指定边框、字体或颜色属性,也没有调用相应的设置方法来设置这些属性值,则当前外观将按照“默认表”中的如下属性名称定义属性值:
警告:此类的已序列化对象与以后的 Swing 版本不兼容。当前序列化支持适用于短期存储,或适用于在运行相同 Swing 版本的应用程序之间进行 RMI(Remote Method Invocation,远程方法调用)。从 1.4 版本开始,已在 java.beans
包中添加了支持所有 JavaBeansTM 长期存储的功能。请参见 XMLEncoder
。
字段摘要 | |
---|---|
static int |
ABOVE_BOTTOM
将标题置于边框底端线的顶部。 |
static int |
ABOVE_TOP
将标题置于边框顶端线的上部。 |
static int |
BELOW_BOTTOM
将标题置于边框底端线的底部。 |
static int |
BELOW_TOP
将标题置于边框顶端线的底部。 |
protected Border |
border
|
static int |
BOTTOM
将标题置于边框底端线的中部。 |
static int |
CENTER
将标题文本置于边框线的中心。 |
static int |
DEFAULT_JUSTIFICATION
标题文本使用默认的对齐方式。 |
static int |
DEFAULT_POSITION
标题文本使用默认的垂直方向。 |
protected static int |
EDGE_SPACING
|
static int |
LEADING
从左到右排列时将标题文本置于边框线的左边,从右到左排列时将标题文本置于边框线的右边。 |
static int |
LEFT
将标题文本置于边框线的左边。 |
static int |
RIGHT
将标题文本置于边框线的右边。 |
protected static int |
TEXT_INSET_H
|
protected static int |
TEXT_SPACING
|
protected String |
title
|
protected Color |
titleColor
|
protected Font |
titleFont
|
protected int |
titleJustification
|
protected int |
titlePosition
|
static int |
TOP
将标题置于边框顶端线的中部。 |
static int |
TRAILING
从左到右排列时将标题文本置于边框线的右边,从右到左排列时将标题文本置于边框线的左边。 |
构造方法摘要 | |
---|---|
TitledBorder(Border border)
创建具有指定边框和空标题的 TitledBorder 实例。 |
|
TitledBorder(Border border,
String title)
创建具有指定边框和标题的 TitledBorder 实例。 |
|
TitledBorder(Border border,
String title,
int titleJustification,
int titlePosition)
用指定的边框、标题、标题对齐方式和标题位置创建 TitledBorder 实例。 |
|
TitledBorder(Border border,
String title,
int titleJustification,
int titlePosition,
Font titleFont)
用指定的边框、标题、标题对齐方式、标题位置和标题字体创建 TitledBorder 实例。 |
|
TitledBorder(Border border,
String title,
int titleJustification,
int titlePosition,
Font titleFont,
Color titleColor)
用指定的边框、标题、标题对齐方式、标题位置、标题字体和标题颜色创建 TitledBorder 实例。 |
|
TitledBorder(String title)
创建 TitledBorder 实例。 |
方法摘要 | |
---|---|
int |
getBaseline(Component c,
int width,
int height)
返回基线。 |
Component.BaselineResizeBehavior |
getBaselineResizeBehavior(Component c)
返回一个枚举,指示该边框的基线如何随大小的改变而发生更改。 |
Border |
getBorder()
返回带标题边框的边框。 |
Insets |
getBorderInsets(Component c)
返回边框的 insets。 |
Insets |
getBorderInsets(Component c,
Insets insets)
用此边框的当前 Insets 重新初始化 insets 参数。 |
protected Font |
getFont(Component c)
|
Dimension |
getMinimumSize(Component c)
返回此边框完全显示边框和标题所需的最小大小。 |
String |
getTitle()
返回带标题边框的标题。 |
Color |
getTitleColor()
返回带标题边框的标题颜色。 |
Font |
getTitleFont()
返回带标题边框的标题字体。 |
int |
getTitleJustification()
返回带标题边框的标题对齐方式。 |
int |
getTitlePosition()
返回带标题边框的标题位置。 |
boolean |
isBorderOpaque()
返回边框是否透明。 |
void |
paintBorder(Component c,
Graphics g,
int x,
int y,
int width,
int height)
按照指定的位置和大小为指定的组件绘制边框。 |
void |
setBorder(Border border)
设置带标题边框的边框。 |
void |
setTitle(String title)
设置带标题边框的标题。 |
void |
setTitleColor(Color titleColor)
设置带标题边框的标题颜色。 |
void |
setTitleFont(Font titleFont)
设置带标题边框的标题字体。 |
void |
setTitleJustification(int titleJustification)
设置带标题边框的标题对齐方式。 |
void |
setTitlePosition(int titlePosition)
设置带标题边框的标题位置。 |
从类 javax.swing.border.AbstractBorder 继承的方法 |
---|
getInteriorRectangle, getInteriorRectangle |
从类 java.lang.Object 继承的方法 |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
字段详细信息 |
---|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
构造方法详细信息 |
---|
1 |
|
title
- 边框应显示的标题1 |
|
border
- 边框1 2 |
|
border
- 边框title
- 边框应显示的标题1 2 3 4 |
|
border
- 边框title
- 边框应显示的标题titleJustification
- 标题的对齐方式titlePosition
- 标题的位置1 2 3 4 5 |
|
border
- 边框title
- 边框应显示的标题titleJustification
- 标题的对齐方式titlePosition
- 标题的位置titleFont
- 显示标题的字体1 2 3 4 5 6 |
|
border
- 边框title
- 边框应显示的标题titleJustification
- 标题的对齐方式titlePosition
- 标题的位置titleFont
- 标题的字体titleColor
- 标题的颜色方法详细信息 |
---|
1 2 3 4 5 6 |
|
Border
中的 paintBorder
AbstractBorder
中的 paintBorder
c
- 要为其绘制边框的组件g
- 绘制的图形x
- 所绘制边框的 x 坐标位置y
- 所绘制边框的 y 坐标位置width
- 所绘制边框的宽度height
- 所绘制边框的高度1 |
|
Border
中的 getBorderInsets
AbstractBorder
中的 getBorderInsets
c
- 要应用此边框 insets 值的组件
Insets
对象1 2 |
|
AbstractBorder
中的 getBorderInsets
c
- 应用此边框 insets 值的组件insets
- 要重新初始化的对象
insets
对象1 |
|
Border
中的 isBorderOpaque
AbstractBorder
中的 isBorderOpaque
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
border
- 边框1 |
|
titlePosition
- 边框的位置1 |
|
titleJustification
- 边框标题的对齐方式1 |
|
titleFont
- 边框标题的字体1 |
|
titleColor
- 边框标题的颜色1 |
|
c
- 将在其上绘制此边框的组件1 2 3 |
|
AbstractBorder
中的 getBaseline
c
- 将为其请求基线的 Component
width
- 为其获取基线的宽度height
- 为其获取基线的高度
NullPointerException
IllegalArgumentException
- 如果宽度或高度 < 0JComponent.getBaseline(int, int)
1 |
|
AbstractBorder
中的 getBaselineResizeBehavior
c
- 为其返回基线调整大小行为的 Component
NullPointerException
JComponent.getBaseline(int, int)
1 |
|
|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
上一个类 下一个类 | 框架 无框架 | |||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |
版权所有 2004 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策。