Class VBox


  • public class VBox
    extends LinearBox
    A vertical flow layout component. Use this layout to place components sequentially in the vertical axis. For custom placements, use the specialized constructor or the 'setLayout' method. Using this component, you can easily stack, distribute or fill a area with components.
    • Field Detail

      • LAYOUT_STACK_TOP

        public static final int LAYOUT_STACK_TOP
        Organizes each element from left to right
        See Also:
        Constant Field Values
      • LAYOUT_STACK_BOTTOM

        public static final int LAYOUT_STACK_BOTTOM
        Organizes each element from right to left
        See Also:
        Constant Field Values
    • Constructor Detail

      • VBox

        public VBox()
        Creates a new VBox component with the default layout options
      • VBox

        public VBox​(int mode,
                    int aligment)
        Creates a new VBox component with the given layout options
    • Method Detail

      • resizeElements

        protected void resizeElements​(int layout,
                                      int alignment)
        Description copied from class: LinearBox
        Recalculates every element's width and height, and also the paddings and spacings every time one of these values are changed.
        Specified by:
        resizeElements in class LinearBox
      • reposition

        public void reposition()
        Reposition this control, calling again setRect with the original parameters.
        Overrides:
        reposition in class Control
      • getPreferredWidth

        public int getPreferredWidth()
        Returns the width of the biggest child component
        Overrides:
        getPreferredWidth in class Control
      • getPreferredHeight

        public int getPreferredHeight()
        Returns the minimal height that encloses all components sequentially
        Overrides:
        getPreferredHeight in class Control