javax.swing.plaf.metal

Class MetalBorders.MenuBarBorder

public static class MetalBorders.MenuBarBorder extends AbstractBorder implements UIResource

A border used for {@link JMenuBar} components.
Field Summary
protected static InsetsborderInsets
The border insets.
Constructor Summary
MenuBarBorder()
Creates a new border instance.
Method Summary
InsetsgetBorderInsets(Component c)
Returns the border insets.
InsetsgetBorderInsets(Component c, Insets insets)
Populates insets with the border insets, then returns it.
voidpaintBorder(Component c, Graphics g, int x, int y, int w, int h)
Paints the border for the component.

Field Detail

borderInsets

protected static Insets borderInsets
The border insets.

Constructor Detail

MenuBarBorder

public MenuBarBorder()
Creates a new border instance.

Method Detail

getBorderInsets

public Insets getBorderInsets(Component c)
Returns the border insets.

Parameters: c the component (ignored).

Returns: The border insets.

getBorderInsets

public Insets getBorderInsets(Component c, Insets insets)
Populates insets with the border insets, then returns it.

Parameters: c the component (ignored). insets the object to populate with the border insets.

Returns: The border insets.

Throws: NullPointerException if insets is null.

paintBorder

public void paintBorder(Component c, Graphics g, int x, int y, int w, int h)
Paints the border for the component. A border is painted only if the component is a selected {@link JMenu} or an armed {@link JMenuItem}.

Parameters: c the component. g the graphics device. x the x-coordinate of the border area. y the y-coordinate of the border area. w the width of the border area. h the height of the border area.