java.lang.Object
javax.swing.border.AbstractBorder
javax.swing.border.StrokeBorder
- 所有已实现的接口:
Serializable
,Border
实现任意笔画边框的类。
Warning: 此类的序列化对象将与未来的 Swing 版本不兼容。当前的序列化支持适用于运行相同版本 Swing 的应用程序之间的短期存储或 RMI。从 1.4 开始,对所有 JavaBeans 的长期存储的支持已添加到 java.beans
包中。请参阅 XMLEncoder
。
- 自从:
- 1.7
-
构造方法总结
构造方法构造方法描述StrokeBorder
(BasicStroke stroke) 创建指定stroke
的边框。StrokeBorder
(BasicStroke stroke, Paint paint) 创建指定stroke
和paint
的边框。 -
方法总结
修饰符和类型方法描述getBorderInsets
(Component c, Insets insets) 使用此边框的当前insets重新初始化insets
参数。getPaint()
返回用于在边框渲染期间生成颜色的Paint
对象。返回用于在边框渲染期间描边形状的BasicStroke
对象。void
paintBorder
(Component c, Graphics g, int x, int y, int width, int height) 使用指定的位置和大小绘制指定组件的边框。在类 javax.swing.border.AbstractBorder 中声明的方法
getBaseline, getBaselineResizeBehavior, getBorderInsets, getInteriorRectangle, getInteriorRectangle, isBorderOpaque
-
构造方法详细信息
-
StrokeBorder
创建指定stroke
的边框。组件的前景色将用于渲染边框。- 参数:
stroke
- 用于描边形状的BasicStroke
对象- 抛出:
NullPointerException
- 如果指定的stroke
是null
-
StrokeBorder
创建指定stroke
和paint
的边框。如果指定的paint
为null
,组件的前景色将用于渲染边框。- 参数:
stroke
- 用于描边形状的BasicStroke
对象paint
- 用于生成颜色的Paint
对象- 抛出:
NullPointerException
- 如果指定的stroke
是null
-
-
方法详情
-
paintBorder
- 指定者:
paintBorder
在接口Border
中- 重写:
paintBorder
在类AbstractBorder
中- 参数:
c
- 为其绘制边框的组件g
- 油漆图形x
- 绘制边框的 x 位置y
- 绘制边框的 y 位置width
- 绘制边框的宽度height
- 绘制边框的高度- 抛出:
NullPointerException
- 如果指定的g
是null
-
getBorderInsets
使用此边框的当前insets重新初始化insets
参数。每个insets都是大于或等于用于绘制边框的笔画线宽的最小(最接近负无穷大)整数值。- 重写:
getBorderInsets
在类AbstractBorder
中- 参数:
c
- 此边框插入值适用的组件insets
- 要重新初始化的Insets
对象- 返回:
-
重新初始化的
insets
参数 - 抛出:
NullPointerException
- 如果指定的insets
是null
- 参见:
-
getStroke
返回用于在边框渲染期间描边形状的BasicStroke
对象。- 返回:
BasicStroke
对象
-
getPaint
返回用于在边框渲染期间生成颜色的Paint
对象。- 返回:
Paint
对象或null
(如果未设置paint
参数)
-