javax.swing.border
public interface Border
To reduce memory consumption, several Components may share a
single Border instance. BorderFactory
is a
factory class for producing commonly used shared borders.
Modifier and Type | Method and Description |
---|---|
Insets |
getBorderInsets(Component c)
Measures the width of this border.
|
boolean |
isBorderOpaque()
Determines whether this border fills every pixel in its area
when painting.
|
void |
paintBorder(Component c,
Graphics g,
int x,
int y,
int width,
int height)
Paints the border for a given component.
|
void paintBorder(Component c, Graphics g, int x, int y, int width, int height)
c
- the component whose border is to be painted.g
- the graphics for painting.x
- the horizontal position for painting the border.y
- the vertical position for painting the border.width
- the width of the available area for painting the border.height
- the height of the available area for painting the border.Insets getBorderInsets(Component c)
c
- the component whose border is to be measured.left
, right
,
top
and bottom
fields indicate the
width of the border at the respective edge.boolean isBorderOpaque()
true
if the border is fully opaque, or
false
if some pixels of the background
can shine through the border.