Javatpoint Logo
Javatpoint Logo

JavaFX FlowPane

FlowPane layout pane organizes the nodes in a flow that are wrapped at the flowpane's boundary. The horizontal flowpane arranges the nodes in a row and wrap them according to the flowpane's width. The vertical flowpane arranges the nodes in a column and wrap them according to the flowpane's height. FlowPane layout is represented by javafx.scene.layout.FlowPane class. We just need to instantiate this class to create the flowpane layout.

Property

There are various properties of the class which are described in the table below.

Property Description Setter Methods
alignment The overall alignment of the flowpane's content. setAlignment(Pos value)
columnHalignment The horizontal alignment of nodes within the columns. setColumnHalignment(HPos Value)
hgap Horizontal gap between the columns. setHgap(Double value)
orientation Orientation of the flowpane setOrientation(Orientation value)
prefWrapLength The preferred height or width where content should wrap in the horizontal or vertical flowpane. setPrefWrapLength(double value)
rowValignment The vertical alignment of the nodes within the rows. setRowValignment(VPos value)
vgap The vertical gap among the rows setVgap(Double value)

Constructors

There are 8 constructors in the class that are given below.

  1. FlowPane()
  2. FlowPane(Double Hgap, Double Vgap)
  3. FlowPane(Double Hgap, Double Vgap, Node? children)
  4. FlowPane(Node... Children)
  5. FlowPane(Orientation orientation)
  6. FlowPane(Orientation orientation, double Hgap, Double Vgap)
  7. FlowPane(Orientation orientation, double Hgap, Double Vgap, Node? children )
  8. FlowPane(Orientation orientation, Node... Children)

Example

Output:


JavaFX FlowPane output
Next TopicJavaFX UI Controls




Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


Preparation


B.Tech / MCA