border
Sets border; null removes the border. Requires a JComponent target.
The border the caller passes is compared by identity, so one built inline is a new border on every recomposition and is written again each time; hoist it into a remember to leave the component's border alone.
A component carries one border, so every border a chain declares - this one, lineBorder and emptyBorder alike - competes for it and the last one wins. Removing the declaration puts back the border the component carried before.
The look and feel of a standard component, other than a panel or a label, paints its own border and may draw over or ignore one declared here; put such a component in a panel and declare the border on the panel instead.
Return
this chain with the border declared on it.
Parameters
the border drawn around the content and counted into the component's insets, so declaring one leaves the content less room than the component's bounds.