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.
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final Border | |
| private static Border | sharedDashedBorder
/ DashedBorder ////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// |
| pack-priv static final Border | |
| pack-priv static final Border | |
| pack-priv static final Border | sharedRaisedBevel
/ BevelBorder ///////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// |
| private static Border | |
| private static Border | |
| private static Border | sharedSoftRaisedBevel
/ SoftBevelBorder /////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static Border | Returns: theBorder objectan integer specifying either
type)BevelBorder.LOWERED or
BevelBorder.RAISEDCreates a beveled border of the specified type, using brighter shades of the component's current background color for highlighting, and darker shading for shadows. |
| public static Border | Returns: theBorder objectan integer specifying either
type, Color BevelBorder.LOWERED or
BevelBorder.RAISEDa highlight, Color Color object for highlightsa shadow)Color object for shadowsCreates a beveled border of the specified type, using the specified highlighting and shadowing. |
| public static Border | Returns: theBorder objectan integer specifying either
type, Color BevelBorder.LOWERED or
BevelBorder.RAISEDa highlightOuter, Color Color object for the
outer edge of the highlight areaa highlightInner, Color Color object for the
inner edge of the highlight areaa shadowOuter, Color Color object for the
outer edge of the shadow areaa shadowInner)Color object for the
inner edge of the shadow areaCreates a beveled border of the specified type, using the specified colors for the inner and outer highlight and shadow areas. |
| public static CompoundBorder | Returns: theCompoundBorder objectCreates a compound border with a |
| public static CompoundBorder | Returns: theCompoundBorder objecta outsideBorder, Border Border object for the outer
edge of the compound bordera insideBorder)Border object for the inner
edge of the compound borderCreates a compound border specifying the border objects to use for the outside and inside edges. |
| public static Border | Returns: theBorder objectthe paint)Paint object used to generate a colorCreates a dashed border of the specified |
| public static Border | Returns: theBorder objectthe paint, float Paint object used to generate a colorthe relative length of a dash line length, float the relative spacing between dash lines spacing)Creates a dashed border of the specified |
| public static Border | Returns: theBorder objectthe paint, float Paint object used to generate a colorthe width of a dash line thickness, float the relative length of a dash line length, float the relative spacing between dash lines spacing, boolean whether or not line ends should be round rounded)Creates a dashed border of the specified |
| public static Border | |
| public static Border | Returns: theBorder objectan integer specifying the width of the top,
in pixels top, int an integer specifying the width of the left side,
in pixels left, int an integer specifying the width of the bottom,
in pixels bottom, int an integer specifying the width of the right side,
in pixels right)Creates an empty border that takes up space but which does no drawing, specifying the width of the top, left, bottom, and right sides. |
| public static Border | Returns: theBorder objectCreates a border with an "etched" look using the component's current background color for highlighting and shading. |
| public static Border | Returns: theBorder objecta highlight, Color Color object for the border highlightsa shadow)Color object for the border shadowsCreates a border with an "etched" look using the specified highlighting and shading colors. |
| public static Border | Returns: theBorder objectone of type)EtchedBorder.RAISED, or
EtchedBorder.LOWEREDCreates a border with an "etched" look using the component's current background color for highlighting and shading. |
| public static Border | Returns: theBorder objectone of type, Color EtchedBorder.RAISED, or
EtchedBorder.LOWEREDa highlight, Color Color object for the border highlightsa shadow)Color object for the border shadowsCreates a border with an "etched" look using the specified highlighting and shading colors. |
| public static Border | Returns: theBorder objecta color)Color to use for the lineCreates a line border with the specified color. |
| public static Border | Returns: theBorder objecta color, int Color to use for the linean integer specifying the width in pixels thickness)Creates a line border with the specified color and width. |
| public static Border | Returns: theBorder objectthe color of the border color, int the thickness of the border thickness, boolean whether or not border corners should be round rounded)Creates a line border with the specified color, thickness, and corner shape. |
| public static Border | Returns: theBorder objectCreates a border with a lowered beveled edge, using brighter shades of the component's current background color for highlighting, and darker shading for shadows. |
| public static Border | Returns: theBorder objectCreates a beveled border with a lowered edge and softened corners, using brighter shades of the component's current background color for highlighting, and darker shading for shadows. |
| public static MatteBorder | Returns: theMatteBorder objectan integer specifying the width of the top,
in pixels top, int an integer specifying the width of the left side,
in pixels left, int an integer specifying the width of the right side,
in pixels bottom, int an integer specifying the width of the bottom,
in pixels right, Color a color)Color to use for the borderCreates a matte-look border using a solid color. |
| public static MatteBorder | Returns: theMatteBorder objectan integer specifying the width of the top,
in pixels top, int an integer specifying the width of the left side,
in pixels left, int an integer specifying the width of the right side,
in pixels bottom, int an integer specifying the width of the bottom,
in pixels right, Icon the tileIcon)Icon object used for the border tilesCreates a matte-look border that consists of multiple tiles of a specified icon. |
| public static Border | Returns: theBorder objectCreates a border with a raised beveled edge, using brighter shades of the component's current background color for highlighting, and darker shading for shadows. |
| public static Border | Returns: theBorder objectCreates a beveled border with a raised edge and softened corners, using brighter shades of the component's current background color for highlighting, and darker shading for shadows. |
| pack-priv static Border | |
| public static Border | Returns: theBorder object or null
if the specified type is not valida type of a bevel type)Creates a beveled border of the specified type with softened corners, using brighter shades of the component's current background color for highlighting, and darker shading for shadows. |
| public static Border | Returns: theBorder objecta type of a bevel type, Color a basic color of the highlight area highlight, Color a basic color of the shadow area shadow)Creates a beveled border of the specified type with softened corners, using the specified highlighting and shadowing. |
| public static Border | Returns: theBorder objecta type of a bevel type, Color a color of the outer edge of the highlight area highlightOuter, Color a color of the inner edge of the highlight area highlightInner, Color a color of the outer edge of the shadow area shadowOuter, Color a color of the inner edge of the shadow area shadowInner)Creates a beveled border of the specified type with softened corners, using the specified colors for the inner and outer edges of the highlight and the shadow areas. |
| public static Border | Returns: theBorder objectthe stroke)BasicStroke object used to stroke a shapeCreates a border of the specified |
| public static Border | Returns: theBorder objectthe stroke, Paint BasicStroke object used to stroke a shapethe paint)Paint object used to generate a colorCreates a border of the specified |
| public static TitledBorder | Returns: theTitledBorder objecta title)String containing the text of the titleCreates a new titled border with the specified title, the default border type (determined by the current look and feel), the default text position (determined by the current look and feel), the default justification (leading), and the default font and text color (determined by the current look and feel). |
| public static TitledBorder | Returns: theTitledBorder objectthe border)Border object to add the title to; if
null the Border is determined
by the current look and feel.Creates a new titled border with an empty title, the specified border object, the default text position (determined by the current look and feel), the default justification (leading), and the default font and text color (determined by the current look and feel). |
| public static TitledBorder | Returns: theTitledBorder objectthe border, String Border object to add the title toa title)String containing the text of the titleAdds a title to an existing border, with default positioning (determined by the current look and feel), default justification (leading) and the default font and text color (determined by the current look and feel). |
| public static TitledBorder | Returns: theTitledBorder objectthe border, String Border object to add the title toa title, int String containing the text of the titlean integer specifying the justification
of the title -- one of the following:
titleJustification, int
an integer specifying the vertical position of
the text in relation to the border -- one of the following:
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). |
| public static TitledBorder | Returns: the TitledBorder objectthe border, String Border object to add the title toa title, int String containing the text of the titlean integer specifying the justification
of the title -- one of the following:
titleJustification, int
an integer specifying the vertical position of
the text in relation to the border -- one of the following:
titlePosition, Font
a Font object specifying the title 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). |
| public static TitledBorder | Returns: theTitledBorder objectthe border, String Border object to add the title toa title, int String containing the text of the titlean integer specifying the justification
of the title -- one of the following:
titleJustification, int
an integer specifying the vertical position of
the text in relation to the border -- one of the following:
titlePosition, Font
a titleFont, Color Font object specifying the title fonta titleColor)Color object specifying the title colorAdds a title to an existing border, with the specified positioning, font and color. |
| emptyBorder | back to summary |
|---|---|
| pack-priv static final Border emptyBorder | |
| sharedDashedBorder | back to summary |
|---|---|
| private static Border sharedDashedBorder / DashedBorder ////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// | |
| sharedEtchedBorder | back to summary |
|---|---|
| pack-priv static final Border sharedEtchedBorder | |
| sharedLoweredBevel | back to summary |
|---|---|
| pack-priv static final Border sharedLoweredBevel | |
| sharedRaisedBevel | back to summary |
|---|---|
| pack-priv static final Border sharedRaisedBevel / BevelBorder ///////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// | |
| sharedRaisedEtchedBorder | back to summary |
|---|---|
| private static Border sharedRaisedEtchedBorder | |
| sharedSoftLoweredBevel | back to summary |
|---|---|
| private static Border sharedSoftLoweredBevel | |
| sharedSoftRaisedBevel | back to summary |
|---|---|
| private static Border sharedSoftRaisedBevel / SoftBevelBorder /////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// | |
| BorderFactory | back to summary |
|---|---|
| private BorderFactory() Don't let anyone instantiate this class | |
| createBevelBorder | back to summary |
|---|---|
| public static Border createBevelBorder(int type) 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.)
| |
| createBevelBorder | back to summary |
|---|---|
| public static Border createBevelBorder(int type, Color highlight, Color shadow) 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. | |
| createBevelBorder | back to summary |
|---|---|
| public static Border createBevelBorder(int type, Color highlightOuter, Color highlightInner, Color shadowOuter, Color shadowInner) Creates a beveled border of the specified type, using the specified colors for the inner and outer highlight and shadow areas.
| |
| createCompoundBorder | back to summary |
|---|---|
| public static CompoundBorder createCompoundBorder() Creates a compound border with a
| |
| createCompoundBorder | back to summary |
|---|---|
| public static CompoundBorder createCompoundBorder(Border outsideBorder, Border insideBorder) Creates a compound border specifying the border objects to use for the outside and inside edges.
| |
| createDashedBorder | back to summary |
|---|---|
| public static Border createDashedBorder(Paint paint) Creates a dashed border of the specified | |
| createDashedBorder | back to summary |
|---|---|
| public static Border createDashedBorder(Paint paint, float length, float spacing) Creates a dashed border of the specified
| |
| createDashedBorder | back to summary |
|---|---|
| public static Border createDashedBorder(Paint paint, float thickness, float length, float spacing, boolean rounded) Creates a dashed border of the specified
| |
| createEmptyBorder | back to summary |
|---|---|
| public static Border createEmptyBorder() Creates an empty border that takes up no space. (The width of the top, bottom, left, and right sides are all zero.)
| |
| createEmptyBorder | back to summary |
|---|---|
| public static Border createEmptyBorder(int top, int left, int bottom, int right) Creates an empty border that takes up space but which does no drawing, specifying the width of the top, left, bottom, and right sides.
| |
| createEtchedBorder | back to summary |
|---|---|
| public static Border createEtchedBorder() Creates a border with an "etched" look using the component's current background color for highlighting and shading.
| |
| createEtchedBorder | back to summary |
|---|---|
| public static Border createEtchedBorder(Color highlight, Color shadow) Creates a border with an "etched" look using the specified highlighting and shading colors. | |
| createEtchedBorder | back to summary |
|---|---|
| public static Border createEtchedBorder(int type) Creates a border with an "etched" look using the component's current background color for highlighting and shading.
| |
| createEtchedBorder | back to summary |
|---|---|
| public static Border createEtchedBorder(int type, Color highlight, Color shadow) Creates a border with an "etched" look using the specified highlighting and shading colors. | |
| createLineBorder | back to summary |
|---|---|
| public static Border createLineBorder(Color color) Creates a line border with the specified color. | |
| createLineBorder | back to summary |
|---|---|
| public static Border createLineBorder(Color color, int thickness) 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
| |
| createLineBorder | back to summary |
|---|---|
| public static Border createLineBorder(Color color, int thickness, boolean rounded) Creates a line border with the specified color, thickness, and corner shape.
| |
| createLoweredBevelBorder | back to summary |
|---|---|
| public static Border 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.)
| |
| createLoweredSoftBevelBorder | back to summary |
|---|---|
| public static Border createLoweredSoftBevelBorder() Creates a beveled border with a lowered edge and softened corners, 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.
| |
| createMatteBorder | back to summary |
|---|---|
| public static MatteBorder createMatteBorder(int top, int left, int bottom, int right, Color color) Creates a matte-look border using a solid color. (The difference between this border and a line border is that you can specify the individual border dimensions.)
| |
| createMatteBorder | back to summary |
|---|---|
| public static MatteBorder createMatteBorder(int top, int left, int bottom, int right, Icon tileIcon) Creates a matte-look border that consists of multiple tiles of a specified icon. Multiple copies of the icon are placed side-by-side to fill up the border area.
Note:
| |
| createRaisedBevelBorder | back to summary |
|---|---|
| public static Border 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.)
| |
| createRaisedSoftBevelBorder | back to summary |
|---|---|
| public static Border createRaisedSoftBevelBorder() Creates a beveled border with a raised edge and softened corners, 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.
| |
| createSharedBevel | back to summary |
|---|---|
| pack-priv static Border createSharedBevel(int type) | |
| createSoftBevelBorder | back to summary |
|---|---|
| public static Border createSoftBevelBorder(int type) Creates a beveled border of the specified type with softened corners,
using brighter shades of the component's current background color
for highlighting, and darker shading for shadows.
The type is either
| |
| createSoftBevelBorder | back to summary |
|---|---|
| public static Border createSoftBevelBorder(int type, Color highlight, Color shadow) Creates a beveled border of the specified type with softened corners,
using the specified highlighting and shadowing.
The type is either
| |
| createSoftBevelBorder | back to summary |
|---|---|
| public static Border createSoftBevelBorder(int type, Color highlightOuter, Color highlightInner, Color shadowOuter, Color shadowInner) Creates a beveled border of the specified type with softened corners,
using the specified colors for the inner and outer edges
of the highlight and the shadow areas.
The type is either Note The shadow inner and outer colors are switched for a lowered bevel border.
| |
| createStrokeBorder | back to summary |
|---|---|
| public static Border createStrokeBorder(BasicStroke stroke) Creates a border of the specified
| |
| createStrokeBorder | back to summary |
|---|---|
| public static Border createStrokeBorder(BasicStroke stroke, Paint paint) Creates a border of the specified
| |
| createTitledBorder | back to summary |
|---|---|
| public static TitledBorder 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 (determined by the current look and feel), the default justification (leading), and the default font and text color (determined by the current look and feel).
| |
| createTitledBorder | back to summary |
|---|---|
| public static TitledBorder createTitledBorder(Border border) Creates a new titled border with an empty title, the specified border object, the default text position (determined by the current look and feel), the default justification (leading), and the default font and text color (determined by the current look and feel).
| |
| createTitledBorder | back to summary |
|---|---|
| public static TitledBorder createTitledBorder(Border border, String title) Adds a title to an existing border, with default positioning (determined by the current look and feel), default justification (leading) and the default font and text color (determined by the current look and feel).
| |
| createTitledBorder | back to summary |
|---|---|
| public static TitledBorder 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 | back to summary |
|---|---|
| public static TitledBorder 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 | back to summary |
|---|---|
| public static TitledBorder createTitledBorder(Border border, String title, int titleJustification, int titlePosition, Font titleFont, Color titleColor) Adds a title to an existing border, with the specified positioning, font and color.
| |