javax.swing.plaf.basic
Class DefaultMenuLayout

java.lang.Object
  extended by javax.swing.BoxLayout
      extended by javax.swing.plaf.basic.DefaultMenuLayout
All Implemented Interfaces:
LayoutManager, LayoutManager2, Serializable, UIResource

public class DefaultMenuLayout
extends BoxLayout
implements UIResource

The LayoutManager that is used in PopupMenus. This is a derived from BoxLayout.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.BoxLayout
LINE_AXIS, PAGE_AXIS, X_AXIS, Y_AXIS
 
Constructor Summary
DefaultMenuLayout(Container target, int axis)
          Creates a new instance of DefaultMenuLayout.
 
Method Summary
 Dimension preferredLayoutSize(Container target)
          Returns the preferred size for the layout of the menu.
 
Methods inherited from class javax.swing.BoxLayout
addLayoutComponent, addLayoutComponent, getLayoutAlignmentX, getLayoutAlignmentY, invalidateLayout, layoutContainer, maximumLayoutSize, minimumLayoutSize, removeLayoutComponent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultMenuLayout

public DefaultMenuLayout(Container target,
                         int axis)
Creates a new instance of DefaultMenuLayout.

Parameters:
target - the component that is laid out
axis - the axis along which the component is laid out
Method Detail

preferredLayoutSize

public Dimension preferredLayoutSize(Container target)
Returns the preferred size for the layout of the menu.

Specified by:
preferredLayoutSize in interface LayoutManager
Overrides:
preferredLayoutSize in class BoxLayout
Parameters:
target - the Container which's preferred size we calculate
Returns:
The dimension of the layout.
See Also:
LayoutManager.minimumLayoutSize(Container)