javax.swing.plaf.metal

Class MetalBorders.ButtonBorder

public static class MetalBorders.ButtonBorder extends AbstractBorder implements UIResource

A border used for {@link JButton} components.

This {@link Border} implementation can handle only instances of {@link AbstractButton} and their subclasses.

If the Metal Look and Feel's current theme is 'Ocean' the border will be painted with a special highlight when the mouse cursor if over the button (ie. the property rollover of the button's model is true) and is not a direct child of a {@link JToolBar}.

Field Summary
protected static InsetsborderInsets
The borders insets.
Constructor Summary
ButtonBorder()
Creates a new instance of ButtonBorder.
Method Summary
InsetsgetBorderInsets(Component c)
Returns the insets of the ButtonBorder.
InsetsgetBorderInsets(Component c, Insets newInsets)
Returns the insets of the ButtonBorder in the specified newInsets object.
voidpaintBorder(Component c, Graphics g, int x, int y, int w, int h)
Paints the button border.

Field Detail

borderInsets

protected static Insets borderInsets
The borders insets.

Constructor Detail

ButtonBorder

public ButtonBorder()
Creates a new instance of ButtonBorder.

Method Detail

getBorderInsets

public Insets getBorderInsets(Component c)
Returns the insets of the ButtonBorder.

Parameters: c the component for which the border is used (ignored).

Returns: The insets of the ButtonBorder.

getBorderInsets

public Insets getBorderInsets(Component c, Insets newInsets)
Returns the insets of the ButtonBorder in the specified newInsets object.

Parameters: c the component for which the border is used (ignored). newInsets the insets object where to put the values ( null not permitted).

Returns: The newInsets reference.

paintBorder

public void paintBorder(Component c, Graphics g, int x, int y, int w, int h)
Paints the button border.

Parameters: c the component for which we paint the border g the Graphics context to use x the X coordinate of the upper left corner of c y the Y coordinate of the upper left corner of c w the width of c h the height of c