Direttamente dalle API:
codice:
setBorder

public void setBorder(Border border)

    Sets the border of this component. The Border object is
 responsible for defining the insets for the component
(overriding any insets set directly on the component)
and for optionally rendering any border decorations within
the bounds of those insets. Borders should be used (rather
than insets) for creating both decorative and non-decorative
(such as margins and padding) regions for a swing component.
Compound borders can be used to nest multiple borders within
a single component.

    This is a bound property.

    Parameters:
        border - the border to be rendered for this component
    See Also:
        Border, CompoundBorder