public class FlowPane extends Pane
A layout pane that arranges its children in a flow, wrapping at the pane's bounds.

A horizontal FlowPane (the default) will lay out nodes in rows, wrapping at the width of the pane. A vertical FlowPane will lay out nodes in columns, wrapping at the height of the pane. If the FlowPane has padding set, the nodes will be laid out within those insets.

  • Constructor Details

    • FlowPane

      public FlowPane()
      Constructs a new FlowPane with horizontal orientation.
    • FlowPane

      public FlowPane(Orientation orientation)
      Constructs a new FlowPane with the given orientation.
      Parameters:
      orientation - the orientation of the flow pane
    • FlowPane

      public FlowPane(int hGap, int vGap)
      Constructs a new FlowPane with the given horizontal and vertical gaps.
      Parameters:
      hGap - the horizontal gap between nodes
      vGap - the vertical gap between nodes
    • FlowPane

      public FlowPane(Orientation orientation, int hGap, int vGap)
      Constructs a new FlowPane with the given orientation, horizontal and vertical gaps.
      Parameters:
      orientation - the orientation of the flow pane
      hGap - the horizontal gap between nodes
      vGap - the vertical gap between nodes
    • FlowPane

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

      public FlowPane(Orientation orientation, Node... children)
      Constructs a new FlowPane with the given orientation and children.
      Parameters:
      orientation - the orientation of the flow pane
      children - the children of the flow pane
    • FlowPane

      public FlowPane(int hGap, int vGap, Node... children)
      Constructs a new FlowPane with the given horizontal and vertical gaps and children.
      Parameters:
      hGap - the horizontal gap between nodes
      vGap - the vertical gap between nodes
      children - the children of the flow pane
    • FlowPane

      public FlowPane(Orientation orientation, int hGap, int vGap, Node... children)
      Constructs a new FlowPane with the given orientation, horizontal and vertical gaps, and children.
      Parameters:
      orientation - the orientation of the flow pane
      hGap - the horizontal gap between nodes
      vGap - the vertical gap between nodes
      children - the children of the flow pane
  • Method Details

    • getOrientation

      public Orientation getOrientation()
      Returns the orientation of the flow pane.
      Returns:
      the orientation of the flow pane
    • setOrientation

      public void setOrientation(Orientation orientation)
      Sets the orientation of the flow pane.
      Parameters:
      orientation - the orientation of the flow pane
    • getHGap

      public int getHGap()
      Returns the amount of space between each node in a horizontal FlowPane or the space between each column in a vertical FlowPane.
      Returns:
      the horizontal gap between nodes
    • setHGap

      public void setHGap(int hGap)
      Sets the amount of space between each node in a horizontal FlowPane or the space between each column in a vertical FlowPane.
      Parameters:
      hGap - the horizontal gap between nodes
    • getVGap

      public int getVGap()
      Returns the amount of space between each node in a vertical FlowPane or the space between each row in a horizontal FlowPane.
      Returns:
      the vertical gap between nodes
    • setVGap

      public void setVGap(int vGap)
      Sets the amount of space between each node in a vertical FlowPane or the space between each row in a horizontal FlowPane.
      Parameters:
      vGap - the vertical gap between nodes
    • layoutChildren

      protected void layoutChildren()
      Overrides:
      layoutChildren in class Parent