public class LineBorder extends AbstractBorder
Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeans™ has been added to the java.beans package. Please see XMLEncoder.
| Modifier and Type | Field and Description |
|---|---|
protected Color |
lineColor
|
protected boolean |
roundedCorners
|
protected int |
thickness
|
| Constructor and Description |
|---|
LineBorder(Color
Creates a line border with the specified color and a thickness = 1.
|
LineBorder(Color
Creates a line border with the specified color and thickness.
|
LineBorder(Color
Creates a line border with the specified color, thickness, and corner shape.
|
| Modifier and Type | Method and Description |
|---|---|
static Border |
createBlackLineBorder()
Convenience method for getting the Color.black LineBorder of thickness 1.
|
static Border |
createGrayLineBorder()
Convenience method for getting the Color.gray LineBorder of thickness 1.
|
Insets |
getBorderInsets(Component
Reinitialize the insets parameter with this Border's current Insets.
|
Color |
getLineColor()
Returns the color of the border.
|
boolean |
getRoundedCorners()
Returns whether this border will be drawn with rounded corners.
|
int |
getThickness()
Returns the thickness of the border.
|
boolean |
isBorderOpaque()
Returns whether or not the border is opaque.
|
void |
paintBorder(Component
Paints the border for the specified component with the specified position and size.
|
getBaseline, getBaselineResizeBehavior, getBorderInsets, getInteriorRectangle, getInteriorRectangleprotected int thickness
protected ColorlineColor
protected boolean roundedCorners
public LineBorder(Colorcolor)
color - the color for the border
public LineBorder(Colorcolor, int thickness)
color - the color of the border
thickness - the thickness of the border
@ConstructorProperties(value={"lineColor","thickness","roundedCorners"}) public LineBorder(Colorcolor, int thickness, boolean roundedCorners)
color - the color of the border
thickness - the thickness of the border
roundedCorners - whether or not border corners should be round
public static BordercreateBlackLineBorder()
public static BordercreateGrayLineBorder()
public void paintBorder(Componentc, Graphics g, int x, int y, int width, int height)
paintBorder in interface
Border
paintBorder in class
AbstractBorder
c - the component for which this border is being painted
g - the paint graphics
x - the x position of the painted border
y - the y position of the painted border
width - the width of the painted border
height - the height of the painted border
public InsetsgetBorderInsets(Component c, Insets insets)
getBorderInsets in class
AbstractBorder
c - the component for which this border insets value applies
insets - the object to be reinitialized
insets object
public ColorgetLineColor()
public int getThickness()
public boolean getRoundedCorners()
public boolean isBorderOpaque()
isBorderOpaque in interface
Border
isBorderOpaque in class
AbstractBorder