border

fun SwingModifier.border(width: Int, brush: Brush, shape: Shape = RectangleShape): SwingModifier

Draws a line width wide along the inside of shape's outline, over the content.

The line is the part of the outline that lies within width of its edge, as AndroidX's border draws it: it stays inside the outline, and a line wider than half the area's shorter side fills the whole outline. An outline other than RectangleShape is drawn with an antialiased edge. A clip declared before the border only cuts the line; declare the clip's shape here for the line to follow it.

It reserves no space, as AndroidX's border does not: space between two lines is a padding declared between them. It is painted after the content so a look and feel's own fill cannot wipe it.

This is a decoration step, not Swing's border property: it paints where it is declared among the decorations, and a look and feel never replaces it. lineBorder writes the Swing border property instead, which reserves its thickness as insets and is what a widget's own painting knows about.

Return

this chain with the border declared on it.

Parameters

width

how wide the line is, in the component's own units; 0 or less draws nothing.

brush

the line's fill, resolved against the decorated box.

shape

the outline the line runs along; the whole decorated box by default.


fun SwingModifier.border(width: Int, color: Color, shape: Shape = RectangleShape): SwingModifier

Draws a line width wide in color along the inside of shape's outline; the solid-color overload of border.

Return

this chain with the border declared on it.

Parameters

width

how wide the line is, in the component's own units; 0 or less draws nothing.

color

the line's color.

shape

the outline the line runs along; the whole decorated box by default.


fun SwingModifier.border(border: BorderStroke, shape: Shape = RectangleShape): SwingModifier

Draws border along the inside of shape's outline; the BorderStroke overload of border.

Return

this chain with the border declared on it.

Parameters

border

the line's width and fill.

shape

the outline the line runs along; the whole decorated box by default.