javax.swing
Class BorderFactory

Factory class for vending standard Border objects. Wherever
possible, this factory will hand out references to shared
Border instances.
For further information and examples see
How
to Use Borders,
a section in The Java Tutorial.

createTitledBorder(Border border)
Creates a new titled border with an empty title,
the specified border object,
the default text position (sitting on the top line),
the default justification (leading), and the default
font and text color (determined by the current look and feel).

createTitledBorder(Border border,
String title)
Adds a title to an existing border,
with default positioning (sitting on the top line),
default justification (leading) and the default
font and text color (determined by the current look and feel).

createTitledBorder(Border border,
String title,
int titleJustification,
int titlePosition)
Adds a title to an existing border, with the specified
positioning and using the default
font and text color (determined by the current look and feel).

createTitledBorder(Border border,
String title,
int titleJustification,
int titlePosition,
Font titleFont)
Adds a title to an existing border, with the specified
positioning and font, and using the default text color
(determined by the current look and feel).

createTitledBorder(String title)
Creates a new titled border with the specified title,
the default border type (determined by the current look and feel),
the default text position (sitting on the top line),
the default justification (leading), and the default
font and text color (determined by the current look and feel).

createLineBorder

Creates a line border with the specified color
and width. The width applies to all four sides of the
border. To specify widths individually for the top,
bottom, left, and right, use
createMatteBorder(int,int,int,int,Color).

Parameters:

color - a Color to use for the line

thickness - an integer specifying the width in pixels

Returns:

the Border object

createRaisedBevelBorder

Creates a border with a raised beveled edge, using
brighter shades of the component's current background color
for highlighting, and darker shading for shadows.
(In a raised border, highlights are on top and shadows
are underneath.)

Returns:

the Border object

createLoweredBevelBorder

Creates a border with a lowered beveled edge, using
brighter shades of the component's current background color
for highlighting, and darker shading for shadows.
(In a lowered border, shadows are on top and highlights
are underneath.)

Returns:

the Border object

createBevelBorder

Creates a beveled border of the specified type, using
brighter shades of the component's current background color
for highlighting, and darker shading for shadows.
(In a lowered border, shadows are on top and highlights
are underneath.)

Parameters:

type - an integer specifying either
BevelBorder.LOWERED or
BevelBorder.RAISED

Returns:

the Border object

createBevelBorder

Creates a beveled border of the specified type, using
the specified highlighting and shadowing. The outer
edge of the highlighted area uses a brighter shade of
the highlight color. The inner edge of the shadow area
uses a brighter shade of the shadow color.

Parameters:

type - an integer specifying either
BevelBorder.LOWERED or
BevelBorder.RAISED

createTitledBorder

Creates a new titled border with the specified title,
the default border type (determined by the current look and feel),
the default text position (sitting on the top line),
the default justification (leading), and the default
font and text color (determined by the current look and feel).

Parameters:

title - a String containing the text of the title

Returns:

the TitledBorder object

createTitledBorder

Creates a new titled border with an empty title,
the specified border object,
the default text position (sitting on the top line),
the default justification (leading), and the default
font and text color (determined by the current look and feel).

Parameters:

border - the Border object to add the title to; if
null the Border is determined
by the current look and feel.

Submit a bug or featureFor further API reference and developer documentation, see Java SE Developer Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.