- java.lang.Object
-
- javax.swing.border.AbstractBorder
-
- javax.swing.border.EmptyBorder
-
- javax.swing.border.MatteBorder
-
- 实现的所有接口
-
Serializable,Border
public class MatteBorder extends EmptyBorder
提供纯色或平铺图标的类似哑光边框的类。警告:此类的序列化对象与以后的Swing版本不兼容。 当前的序列化支持适用于运行相同版本Swing的应用程序之间的短期存储或RMI。 从1.4开始,
java.beans软件包中添加了对所有JavaBeansjava.beans长期存储的支持。 请参阅XMLEncoder。- 另请参见:
- Serialized Form
-
-
构造方法摘要
构造方法 构造器 描述 MatteBorder(int top, int left, int bottom, int right, Color matteColor)使用指定的insets和颜色创建遮罩边框。MatteBorder(int top, int left, int bottom, int right, Icon tileIcon)使用指定的insets和tile图标创建遮罩边框。MatteBorder(Insets borderInsets, Color matteColor)使用指定的insets和颜色创建遮罩边框。MatteBorder(Insets borderInsets, Icon tileIcon)使用指定的insets和tile图标创建遮罩边框。MatteBorder(Icon tileIcon)使用指定的图块图标创建遮罩边框。
-
方法摘要
所有方法 实例方法 具体的方法 变量和类型 方法 描述 InsetsgetBorderInsets()返回边框的insets。InsetsgetBorderInsets(Component c, Insets insets)使用此Border的当前Insets重新初始化insets参数。ColorgetMatteColor()返回用于平铺边框的颜色,如果正在使用图块图标,则返回null。IcongetTileIcon()返回用于平铺边框的图标,如果使用纯色,则返回null。booleanisBorderOpaque()返回边框是否不透明。voidpaintBorder(Component c, Graphics g, int x, int y, int width, int height)涂抹哑光边框。-
声明方法的类 javax.swing.border.AbstractBorder
getBaseline, getBaselineResizeBehavior, getBorderInsets, getInteriorRectangle, getInteriorRectangle
-
-
-
-
构造方法详细信息
-
MatteBorder
public MatteBorder(int top, int left, int bottom, int right, Color matteColor)使用指定的insets和颜色创建遮罩边框。- 参数
-
top- 边界的顶部插图 -
left- 边界的左侧插图 -
bottom- 边界的底部插图 -
right- 边界的右边插图 -
matteColor- 为边框渲染的颜色
-
MatteBorder
public MatteBorder(Insets borderInsets, Color matteColor)
使用指定的insets和颜色创建遮罩边框。- 参数
-
borderInsets- 边界的插图 -
matteColor- 为边框渲染的颜色 - 从以下版本开始:
- 1.3
-
MatteBorder
public MatteBorder(int top, int left, int bottom, int right, Icon tileIcon)使用指定的insets和tile图标创建遮罩边框。- 参数
-
top- 边界的顶部插图 -
left- 边界的左侧插图 -
bottom- 边界的底部插图 -
right- 边界的右边插图 -
tileIcon- 用于平铺边框的图标
-
MatteBorder
public MatteBorder(Insets borderInsets, Icon tileIcon)
使用指定的insets和tile图标创建遮罩边框。- 参数
-
borderInsets- 边界的内容 -
tileIcon- 用于平铺边框的图标 - 从以下版本开始:
- 1.3
-
MatteBorder
public MatteBorder(Icon tileIcon)
使用指定的图块图标创建遮罩边框。 将根据图块图标的大小动态计算插图,其中顶部和底部将等于图块图标的高度,左侧和右侧将等于图块图标的宽度。- 参数
-
tileIcon- 用于平铺边框的图标
-
-
方法详细信息
-
paintBorder
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height)
涂抹哑光边框。- Specified by:
-
paintBorder在界面Border - 重写:
-
paintBorder在类EmptyBorder - 参数
-
c- 正在为其绘制边框的组件 -
g- 油漆图形 -
x- 绘边框的x位置 -
y- 绘边框的y位置 -
width- 绘边框的宽度 -
height- 绘边框的高度
-
getBorderInsets
public Insets getBorderInsets(Component c, Insets insets)
使用此Border的当前Insets重新初始化insets参数。- 重写:
-
getBorderInsets在类EmptyBorder - 参数
-
c- 应用此border insets值的组件 -
insets- 要重新初始化的对象 - 结果
-
insets对象 - 从以下版本开始:
- 1.3
-
getBorderInsets
public Insets getBorderInsets()
返回边框的insets。- 重写:
-
getBorderInsets在类EmptyBorder - 结果
-
一个
Insets对象,包含顶部,左侧,底部和右侧的插入 - 从以下版本开始:
- 1.3
-
getMatteColor
public Color getMatteColor()
返回用于平铺边框的颜色,如果正在使用图块图标,则返回null。- 结果
-
Color用于渲染边框的对象,如果使用了图块图标,则为null - 从以下版本开始:
- 1.3
-
getTileIcon
public Icon getTileIcon()
返回用于平铺边框的图标,如果使用纯色,则返回null。- 结果
-
Icon用于平铺边框或null如果使用纯色填充边框 - 从以下版本开始:
- 1.3
-
isBorderOpaque
public boolean isBorderOpaque()
返回边框是否不透明。- Specified by:
-
isBorderOpaque在接口Border - 重写:
-
isBorderOpaque类EmptyBorder - 结果
-
true如果边框不透明,false
-
-