java.lang.Object
javax.swing.border.AbstractBorder
javax.swing.border.EmptyBorder
- 所有已实现的接口:
Serializable,Border
一个提供空白透明边框的类,它占用空间但不绘制。
Warning: 此类的序列化对象将与未来的 Swing 版本不兼容。当前的序列化支持适用于运行相同版本 Swing 的应用程序之间的短期存储或 RMI。从 1.4 开始,对所有 JavaBeans 的长期存储的支持已添加到 java.beans 包中。请参阅 XMLEncoder 。
-
字段摘要
字段 -
构造方法总结
构造方法构造方法描述EmptyBorder(int top, int left, int bottom, int right) 创建具有指定insets的空边框。EmptyBorder(Insets borderInsets) 创建具有指定insets的空边框。 -
方法总结
修饰符和类型方法描述返回边框的insets。getBorderInsets(Component c, Insets insets) 使用此边框的当前 Insets 重新初始化 insets 参数。boolean返回边框是否不透明。voidpaintBorder(Component c, Graphics g, int x, int y, int width, int height) 默认不绘制。在类 javax.swing.border.AbstractBorder 中声明的方法
getBaseline, getBaselineResizeBehavior, getBorderInsets, getInteriorRectangle, getInteriorRectangle
-
字段详细信息
-
left
protected int left边框的左侧insets。 -
right
protected int right边框的右insets。 -
top
protected int top边框的顶部insets。 -
bottom
protected int bottom边框的底部insets。
-
-
构造方法详细信息
-
EmptyBorder
public EmptyBorder(int top, int left, int bottom, int right) 创建具有指定insets的空边框。- 参数:
top- 边框的顶部insetsleft- 边框的左insetsbottom- 边框的底部insetsright- 边框的右insets
-
EmptyBorder
创建具有指定insets的空边框。- 参数:
borderInsets- 边框的insets- 抛出:
NullPointerException- 如果指定的borderInsets是null
-
-
方法详情
-
paintBorder
默认不绘制。- 指定者:
paintBorder在接口Border中- 重写:
paintBorder在类AbstractBorder中- 参数:
c- 为其绘制边框的组件g- 油漆图形x- 绘制边框的 x 位置y- 绘制边框的 y 位置width- 绘制边框的宽度height- 绘制边框的高度
-
getBorderInsets
使用此边框的当前 Insets 重新初始化 insets 参数。- 重写:
getBorderInsets在类AbstractBorder中- 参数:
c- 此边框插入值适用的组件insets- 要重新初始化的对象- 返回:
insets对象- 抛出:
NullPointerException- 如果指定的insets是null
-
getBorderInsets
返回边框的insets。- 返回:
-
一个
Insets对象,包含顶部、左侧、底部和右侧的insets - 自从:
- 1.3
-
isBorderOpaque
public boolean isBorderOpaque()返回边框是否不透明。默认返回假。- 指定者:
isBorderOpaque在接口Border中- 重写:
isBorderOpaque在类AbstractBorder中- 返回:
- false
-