Java Reference
In-Depth Information
public EtchedBorder()
Border etchedBorder = new EtchedBorder();
public EtchedBorder(int etchType)
Border etchedBorder = new EtchedBorder(EtchedBorder.RAISED);
public EtchedBorder(Color highlight, Color shadow)
Border etchedBorder = new EtchedBorder(Color.RED, Color.PINK);
public EtchedBorder(int etchType, Color highlight, Color shadow)
Border etchedBorder = new EtchedBorder(EtchedBorder.RAISED, Color.RED,
Color.PINK);
public static Border createEtchedBorder()
Border etchedBorder = BorderFactory.createEtchedBorder();
public static Border createEtchedBorder(Color highlight, Color shadow)
Border etchedBorder = BorderFactory.createEtchedBorder(Color.RED, Color.PINK);
public static Border createEtchedBorder(EtchedBorder.RAISED)
Border etchedBorder = BorderFactory.createEtchedBorder(Color.RED, Color.PINK);
public static Border createEtchedBorder(int type, Color highlight, Color shadow)
Border etchedBorder = BorderFactory.createEtchedBorder(EtchedBorder.RAISED,
Color.RED, Color.PINK);
Each allows you to customize both the etching type and the coloration of the highlighting
and shadowing within the border. If no etching type is specified, the border is lowered. As with
BevelBorder
and
SoftBevelBorder
, you can specify the etching type through one of two constants:
EtchedBorder.RAISED
or
EtchedBorder.LOWERED
. Again, if no colors are specified, they're derived
from the background color of the component passed into
paintBorder()
. By default, all
EtchedBorder
objects are created to be opaque.
MatteBorder Class
MatteBorder
is one of the more versatile borders available. It comes in two varieties. The first is
demonstrated in Figure 7-9 and shows a
MatteBorder
used like a
LineBorder
to fill the border
with a specific color, but with a different thickness on each side (something a plain
LineBorder
cannot handle).