javax.swing.plaf

Class BorderUIResource.EtchedBorderUIResource

public static class BorderUIResource.EtchedBorderUIResource extends EtchedBorder implements UIResource, Serializable

An {@link javax.swing.border.EtchedBorder} that also implements the {@link UIResource} marker interface. This is useful for implementing pluggable look-and-feels: When switching the current LookAndFeel, only those borders are replaced that are marked as {@link UIResource}. For this reason, a look-and-feel should always install borders that implement UIResource, such as the borders provided by this class.

[An illustration of the two EtchedBorder
 variants]

Constructor Summary
EtchedBorderUIResource()
Constructs an EtchedBorderUIResource that appears lowered into the surface.
EtchedBorderUIResource(int etchType)
Constructs an EtchedBorderUIResource with the specified appearance.
EtchedBorderUIResource(Color highlight, Color shadow)
Constructs a lowered EtchedBorderUIResource, explicitly selecting the colors that will be used for highlight and shadow.
EtchedBorderUIResource(int etchType, Color highlight, Color shadow)
Constructs an EtchedBorderUIResource with the specified appearance, explicitly selecting the colors that will be used for highlight and shadow.

Constructor Detail

EtchedBorderUIResource

public EtchedBorderUIResource()
Constructs an EtchedBorderUIResource that appears lowered into the surface. The colors will be derived from the background color of the enclosed Component when the border gets painted.

EtchedBorderUIResource

public EtchedBorderUIResource(int etchType)
Constructs an EtchedBorderUIResource with the specified appearance. The colors will be derived from the background color of the enclosed Component when the border gets painted.

[An illustration of the two
 EtchedBorder variants]

Parameters: etchType the desired appearance of the border. The value must be either {@link javax.swing.border.EtchedBorder#RAISED} or {@link javax.swing.border.EtchedBorder#LOWERED}.

Throws: IllegalArgumentException if etchType has an unsupported value.

EtchedBorderUIResource

public EtchedBorderUIResource(Color highlight, Color shadow)
Constructs a lowered EtchedBorderUIResource, explicitly selecting the colors that will be used for highlight and shadow.

Parameters: highlight the color that will be used for painting the highlight part of the border. shadow the color that will be used for painting the shadow part of the border.

See Also: EtchedBorderUIResource

EtchedBorderUIResource

public EtchedBorderUIResource(int etchType, Color highlight, Color shadow)
Constructs an EtchedBorderUIResource with the specified appearance, explicitly selecting the colors that will be used for highlight and shadow.

[An illustration that shows which pixels get
 painted in what color]

Parameters: etchType the desired appearance of the border. The value must be either {@link javax.swing.border.EtchedBorder#RAISED} or {@link javax.swing.border.EtchedBorder#LOWERED}. highlight the color that will be used for painting the highlight part of the border. shadow the color that will be used for painting the shadow part of the border.

Throws: IllegalArgumentException if etchType has an unsupported value.