Class AlignedBox

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class AlignedBox extends Box
Utility class that extends Box so that added components are always considered to have a fixed alignment. This is useful if you want, for instance, all the components added to a vertical box to appear aligned along the left hand side.
Since:
11 Apr 2018
Author:
Mark Taylor
See Also:
  • Constructor Details

    • AlignedBox

      public AlignedBox(int axis, float alignment)
      Constructor.
      Parameters:
      axis - one of the BoxLayout axis values
      alignment - alignment value applied to the perpendicular axis of components added to this container
  • Method Details

    • addImpl

      public void addImpl(Component c, Object constraints, int index)
      Overrides:
      addImpl in class Container
    • createVerticalBox

      public static AlignedBox createVerticalBox()
      Creates a vertical box in which all components added will have alignmentX of zero.
      Returns:
      vertical box with alignment along the left edge
    • createHorizontalBox

      public static AlignedBox createHorizontalBox()
      Creates a horizontal box in which all components added will have alignmentY of zero.
      Returns:
      horizontal box with alignment along the top edge