public class HBox extends Pane
A layout pane that arranges its children in a horizontal row.
  • Constructor Details

    • HBox

      public HBox()
      Constructs a new HBox with a spacing of 0.
    • HBox

      public HBox(int spacing)
      Constructs a new HBox with the given spacing.
      Parameters:
      spacing - the horizontal spacing between children
    • HBox

      public HBox(Node... children)
      Constructs a new HBox with the given children.
      Parameters:
      children - the children of the HBox
    • HBox

      public HBox(int spacing, Node... children)
      Constructs a new HBox with the given spacing and children.
      Parameters:
      spacing - the horizontal spacing between children
      children - the children of the HBox
  • Method Details

    • getSpacing

      public int getSpacing()
      Returns the amount of horizontal space between each child node.
      Returns:
      the horizontal spacing between children
    • setSpacing

      public void setSpacing(int spacing)
      Sets the amount of horizontal space between each child node.
      Parameters:
      spacing - the horizontal spacing between children
    • layoutChildren

      protected void layoutChildren()
      Overrides:
      layoutChildren in class Parent