javax.swing.border
Interface Border

All Known Implementing Classes:
AbstractBorder, BasicBorders.ButtonBorder, BasicBorders.FieldBorder, BasicBorders.MarginBorder, BasicBorders.MenuBarBorder, BasicBorders.RadioButtonBorder, BasicBorders.RolloverButtonBorder, BasicBorders.SplitPaneBorder, BasicBorders.ToggleButtonBorder, BevelBorder, BorderUIResource, BorderUIResource.BevelBorderUIResource, BorderUIResource.CompoundBorderUIResource, BorderUIResource.EmptyBorderUIResource, BorderUIResource.EtchedBorderUIResource, BorderUIResource.LineBorderUIResource, BorderUIResource.MatteBorderUIResource, BorderUIResource.TitledBorderUIResource, CompoundBorder, EmptyBorder, EtchedBorder, LineBorder, MatteBorder, MetalBorders.ButtonBorder, MetalBorders.Flush3DBorder, MetalBorders.InternalFrameBorder, MetalBorders.MenuBarBorder, MetalBorders.MenuItemBorder, MetalBorders.OptionDialogBorder, MetalBorders.PaletteBorder, MetalBorders.PopupMenuBorder, MetalBorders.RolloverButtonBorder, MetalBorders.ScrollPaneBorder, MetalBorders.TableHeaderBorder, MetalBorders.TextFieldBorder, MetalBorders.ToggleButtonBorder, MetalBorders.ToolBarBorder, SoftBevelBorder, TitledBorder

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. BorderFactory is a factory class for producing commonly used shared borders.

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

Method Summary
 Insets getBorderInsets(Component c)
          Measures the width of this border.
 boolean isBorderOpaque()
          Determines whether this border fills every pixel in its area when painting.
 void paintBorder(Component c, Graphics g, int x, int y, int width, int height)
          Paints the border for a given component.
 

Method Detail

paintBorder

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.

getBorderInsets

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

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.