java.lang.Object
javax.swing.border.AbstractBorder
javax.swing.border.EmptyBorder
javax.swing.border.MatteBorder
- 所有已实现的接口:
Serializable
,Border
提供纯色或平铺图标的类似磨砂边框的类。
Warning: 此类的序列化对象将与未来的 Swing 版本不兼容。当前的序列化支持适用于运行相同版本 Swing 的应用程序之间的短期存储或 RMI。从 1.4 开始,对所有 JavaBeans 的长期存储的支持已添加到 java.beans
包中。请参阅 XMLEncoder
。
-
字段摘要
字段在类 javax.swing.border.EmptyBorder 中声明的字段
bottom, left, right, top
-
构造方法总结
构造方法构造方法描述MatteBorder
(int top, int left, int bottom, int right, Color matteColor) 创建具有指定insets和颜色的无光泽边框。MatteBorder
(int top, int left, int bottom, int right, Icon tileIcon) 使用指定的insets和平铺图标创建磨砂边框。MatteBorder
(Insets borderInsets, Color matteColor) 创建具有指定insets和颜色的无光泽边框。MatteBorder
(Insets borderInsets, Icon tileIcon) 使用指定的insets和平铺图标创建磨砂边框。MatteBorder
(Icon tileIcon) 使用指定的图块图标创建一个无光泽边框。 -
方法总结
修饰符和类型方法描述返回边框的insets。getBorderInsets
(Component c, Insets insets) 使用此边框的当前 Insets 重新初始化 insets 参数。返回用于平铺边框的颜色,如果使用平铺图标,则返回 null。返回用于平铺边框的图标,如果使用纯色则返回 null。boolean
返回边框是否不透明。void
paintBorder
(Component c, Graphics g, int x, int y, int width, int height) 绘制无光泽边框。在类 javax.swing.border.AbstractBorder 中声明的方法
getBaseline, getBaselineResizeBehavior, getBorderInsets, getInteriorRectangle, getInteriorRectangle
-
字段详细信息
-
color
为边框呈现的颜色。 -
tileIcon
用于平铺边框的图标。
-
-
构造方法详细信息
-
MatteBorder
创建具有指定insets和颜色的无光泽边框。- 参数:
top
- 边框的顶部insetsleft
- 边框的左insetsbottom
- 边框的底部insetsright
- 边框的右insetsmatteColor
- 为边框呈现的颜色
-
MatteBorder
创建具有指定insets和颜色的无光泽边框。- 参数:
borderInsets
- 边框的insetsmatteColor
- 为边框呈现的颜色- 抛出:
NullPointerException
- 如果指定的borderInsets
是null
- 自从:
- 1.3
-
MatteBorder
使用指定的insets和平铺图标创建磨砂边框。- 参数:
top
- 边框的顶部insetsleft
- 边框的左insetsbottom
- 边框的底部insetsright
- 边框的右insetstileIcon
- 用于平铺边框的图标
-
MatteBorder
使用指定的insets和平铺图标创建磨砂边框。- 参数:
borderInsets
- 边框的insetstileIcon
- 用于平铺边框的图标- 抛出:
NullPointerException
- 如果指定的borderInsets
是null
- 自从:
- 1.3
-
MatteBorder
使用指定的图块图标创建一个无光泽边框。insets将根据磁贴图标的大小动态计算,其中顶部和底部等于磁贴图标的高度,左侧和右侧等于磁贴图标的宽度。- 参数:
tileIcon
- 用于平铺边框的图标
-
-
方法详情
-
paintBorder
绘制无光泽边框。- 指定者:
paintBorder
在接口Border
中- 重写:
paintBorder
在类EmptyBorder
中- 参数:
c
- 为其绘制边框的组件g
- 油漆图形x
- 绘制边框的 x 位置y
- 绘制边框的 y 位置width
- 绘制边框的宽度height
- 绘制边框的高度
-
getBorderInsets
使用此边框的当前 Insets 重新初始化 insets 参数。- 重写:
getBorderInsets
在类EmptyBorder
中- 参数:
c
- 此边框插入值适用的组件insets
- 要重新初始化的对象- 返回:
insets
对象- 抛出:
NullPointerException
- 如果指定的insets
是null
- 自从:
- 1.3
-
getBorderInsets
返回边框的insets。- 重写:
getBorderInsets
在类EmptyBorder
中- 返回:
-
一个
Insets
对象,包含顶部、左侧、底部和右侧的insets - 自从:
- 1.3
-
getMatteColor
返回用于平铺边框的颜色,如果使用平铺图标,则返回 null。- 返回:
-
用于呈现边框的
Color
对象或null
(如果使用平铺图标) - 自从:
- 1.3
-
getTileIcon
返回用于平铺边框的图标,如果使用纯色则返回 null。- 返回:
Icon
用于平铺边框或null
(如果使用纯色填充边框)- 自从:
- 1.3
-
isBorderOpaque
public boolean isBorderOpaque()返回边框是否不透明。- 指定者:
isBorderOpaque
在接口Border
中- 重写:
isBorderOpaque
在类EmptyBorder
中- 返回:
true
如果边框不透明,false
否则
-