
CHAPTER 24
Thejavax.swing.border Package
The javax.swing .border package is a simple package that defines the Border inter face,
which specifies how to draw a border around an arbitrary Swing component. The
various classes in this package implement commonly used border styles. Applica-
tions can easily define custom border styles by creating custom implementations of
Border. Figur e 24-1 shows the class hierarchy of this package.
extends implements
KEY
CLASS INTERFACEABSTRACT CLASS
AbstractBorder BevelBorder
javax.swing.border
java.lang
Object
java.io
CompoundBorder
EmptyBorder
EtchedBorder
LineBorder
TitleBorder
MatteBorder
Border
SoftBevelBorder
Serializable
Figur e 24−1: The javax.swing.bor der package
AbstractBorder Ja va 1.2
javax.swing .border serializable
This abstract class implements a zero-width, nonopaque border. AbstractBorder imple-
ments the Border inter face. To create a custom border type, subclass AbstractBorder,reim-
plementing at least the getBorderInsets() and paintBorder() methods. getInteriorRectangle() in
javax.swing.
border
519
14 September 1999 10:23