Top Description Methods
javax.swing.border

public Interface Border

Known Direct Implementers
javax.swing.plaf.BorderUIResource, javax.swing.plaf.basic.BasicBorders.SplitPaneDividerBorder, javax.swing.plaf.basic.BasicBorders.SplitPaneBorder, javax.swing.plaf.nimbus.NimbusDefaults.PainterBorder, javax.swing.plaf.nimbus.LoweredBorder, javax.swing.text.html.HiddenTagView.StartTagBorder, javax.swing.text.html.HiddenTagView.EndTagBorder, javax.swing.border.AbstractBorder
Imports
java.awt.Graphics, .Insets, .Rectangle, .Component

Interface describing an object capable of rendering a border around the edges of a swing component. For examples of using borders see How to Use Borders, a section in The Java Tutorial.

In the Swing component set, borders supersede Insets as the mechanism for creating a (decorated or plain) area around the edge of a component.

Usage Notes:

Authors
David Kloba, Amy Fowler
See Also
javax.swing.BorderFactory, EmptyBorder, CompoundBorder

Method Summary

Modifier and TypeMethod and Description
public Insets

Returns:

an Insets object containing the insets from top, left, bottom and right of this Border
getBorderInsets
(Component
the component for which this border insets value applies
c
)

Returns the insets of the border.

public boolean

Returns:

true if this Border is opaque
isBorderOpaque
()

Returns whether or not the border is opaque.

public void
paintBorder(Component
the component for which this border is being painted
c
,
Graphics
the paint graphics
g
,
int
the x position of the painted border
x
,
int
the y position of the painted border
y
,
int
the width of the painted border
width
,
int
the height of the painted border
height
)

Paints the border for the specified component with the specified position and size.

Method Detail

getBorderInsetsback to summary
public Insets getBorderInsets(Component c)

Returns the insets of the border.

Parameters
c:Component

the component for which this border insets value applies

Returns:Insets

an Insets object containing the insets from top, left, bottom and right of this Border

isBorderOpaqueback to summary
public boolean isBorderOpaque()

Returns whether or not the border is opaque. If the border is opaque, it is responsible for filling in it's own background when painting.

Returns:boolean

true if this Border is opaque

paintBorderback to summary
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height)

Paints the border for the specified component with the specified position and size.

Parameters
c:Component

the component for which this border is being painted

g:Graphics

the paint graphics

x:int

the x position of the painted border

y:int

the y position of the painted border

width:int

the width of the painted border

height:int

the height of the painted border