Java Reference
In-Depth Information
SoftBevelBorder
has three constructors:
public SoftBevelBorder(int bevelType)
Border softBevelBorder = new SoftBevelBorder(SoftBevelBorder.RAISED);
public SoftBevelBorder(int bevelType, Color highlight, Color shadow)
Border softBevelBorder = new SoftBevelBorder(SoftBevelBorder.RAISED, Color.RED,
Color.PINK);
public SoftBevelBorder(int bevelType, Color highlightOuter, Color highlightInner,
Color shadowOuter, Color shadowInner)
Border softBevelBorder = new SoftBevelBorder(SoftBevelBorder.RAISED, Color.RED,
Color.RED.darker(), Color.PINK, Color.PINK.brighter());
Each allows you to customize both the bevel type and the coloration of the highlighting
and shadowing within the border. The bevel type is specified by one of two values:
SoftBevelBorder.RAISED
or
SoftBevelBorder.LOWERED
. As with
BevelBorder
, the default colora-
tion is derived from the background color. A soft bevel border doesn't completely fill in the
given insets area, so a
SoftBevelBorder
is created to be transparent (not opaque).
There are no static
BorderFactory
methods to create these borders.
EtchedBorder Class
An
EtchedBorder
is a special case of a
BevelBorder
, but it's not a subclass. When the outer high-
light color of a
BevelBorder
is the same color as the inner shadow color and the outer shadow
color is the same color as the inner highlight color, you have an
EtchedBorder
. (See Figure 7-6
earlier in this chapter for a depiction of bevel colors.) Figure 7-8 shows what a raised and
lowered etched border might look like.
Figure 7-8.
EtchedBorder samples
There are four constructors for
EtchedBorder
, as well as four factory methods of
BorderFactory
for creating
EtchedBorder
objects: