javax.swing.border

Interface Border

public interface Border

An public interface for decorative or spacing borders around a Component.

To reduce memory consumption, several Components may share a single Border instance. {@link javax.swing.BorderFactory} is a factory class for producing commonly used shared borders.

See Also: BorderFactory EmptyBorder CompoundBorder BevelBorder EtchedBorder LineBorder MatteBorder SoftBevelBorder TitledBorder

Method Summary
InsetsgetBorderInsets(Component c)
Measures the width of this border.
booleanisBorderOpaque()
Determines whether this border fills every pixel in its area when painting.
voidpaintBorder(Component c, Graphics g, int x, int y, int width, int height)
Paints the border for a given component.

Method Detail

getBorderInsets

public Insets getBorderInsets(Component c)
Measures the width of this border.

Parameters: c the component whose border is to be measured.

Returns: an Insets object whose left, right, top and bottom fields indicate the width of the border at the respective edge.

isBorderOpaque

public boolean isBorderOpaque()
Determines whether this border fills every pixel in its area when painting.

Returns: true if the border is fully opaque, or false if some pixels of the background can shine through the border.

paintBorder

public void paintBorder(Component c, Graphics g, int x, int y, int width, int height)
Paints the border for a given component.

Parameters: c the component whose border is to be painted. g the graphics for painting. x the horizontal position for painting the border. y the vertical position for painting the border. width the width of the available area for painting the border. height the height of the available area for painting the border.