Class HBox


  • public class HBox
    extends LinearBox
    A horizontal flow layout component. Use this layout to place components sequentially in the horizontal 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_LEFT

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

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

      • HBox

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

        public HBox​(int mode,
                    int aligment)
        Creates a new HBox component with the default 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 minimal width that encloses all components sequentially
        Overrides:
        getPreferredWidth in class Control
      • getPreferredHeight

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