Border instances are designed to be shared. Rather than creating
a new border object using one of border classes, use the
BorderFactory methods, which produces a shared instance of the
common border types.

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.