- java.lang.Object
-
- javax.swing.border.AbstractBorder
-
- javax.swing.border.EmptyBorder
-
- All Implemented Interfaces:
-
Serializable,Border
public class EmptyBorder extends AbstractBorder implements Serializable
一个提供一个空的透明边框的类,占用空间但不绘图。警告:此类的序列化对象与将来的Swing版本不兼容。 当前的序列化支持适用于运行相同版本的Swing的应用程序之间的短期存储或RMI。 从1.4开始,对所有JavaBeans的长期存储的支持已被添加到
java.beans包中。 请参阅XMLEncoder。- 另请参见:
- Serialized Form
-
-
构造方法摘要
构造方法 Constructor 描述 EmptyBorder(int top, int left, int bottom, int right)使用指定的插图创建空白边框。EmptyBorder(Insets borderInsets)使用指定的插图创建空白边框。
-
方法摘要
所有方法 接口方法 具体的方法 Modifier and Type 方法 描述 InsetsgetBorderInsets()返回边框的插入。InsetsgetBorderInsets(Component c, Insets insets)使用此Border的当前Insets重新初始化insets参数。booleanisBorderOpaque()返回边框是否不透明。voidpaintBorder(Component c, Graphics g, int x, int y, int width, int height)默认情况下不绘图。-
Methods inherited from class javax.swing.border.AbstractBorder
getBaseline, getBaselineResizeBehavior, getBorderInsets, getInteriorRectangle, getInteriorRectangle
-
-
-
-
构造方法详细信息
-
EmptyBorder
public EmptyBorder(int top, int left, int bottom, int right)使用指定的插图创建空白边框。- 参数
-
top- 边界的顶部插图 -
left- 边框的左边插图 -
bottom- 边框的底部插图 -
right- 边界的正确插图
-
EmptyBorder
@ConstructorProperties("borderInsets") public EmptyBorder(Insets borderInsets)
使用指定的插图创建空白边框。- 参数
-
borderInsets- 边界的插图
-
-
方法详细信息
-
paintBorder
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height)
默认情况下不绘图。- Specified by:
-
paintBorder在接口Border - 重写:
-
paintBorder在AbstractBorder - 参数
-
c- 正在绘制此边框的组件 -
g- 油漆图形 -
x- 绘画边框的x位置 -
y- 绘画边框的y位置 -
width- 绘制边框的宽度 -
height- 绘画边框的高度
-
getBorderInsets
public Insets getBorderInsets(Component c, Insets insets)
使用此Border的当前Insets重新初始化insets参数。- 重写:
-
getBorderInsets在AbstractBorder类 - 参数
-
c- 应用此边界插入值的组件 -
insets- 要重新初始化的对象 - 结果
-
insets对象
-
getBorderInsets
public Insets getBorderInsets()
返回边框的插入。- 结果
-
一个
Insets对象,包含顶部,左侧,底部和右侧的插入 - 从以下版本开始:
- 1.3
-
isBorderOpaque
public boolean isBorderOpaque()
返回边框是否不透明。 默认情况下返回false。- Specified by:
-
isBorderOpaque在接口Border - 重写:
-
isBorderOpaque中的AbstractBorder - 结果
- 假
-
-