JavaFX AnchorPane
JavaFX BorderPane
JavaFX FlowPane
JavaFX GridPane
The GridPane allows us to layout components within cells. The grid contains rows and columns.
Every cell in a single column will have the same width but different columns can have different
widths. Similarly, every cell in a single row will have the same height but different rows can have
different heights.
We can specify both the horizontal and vertical gaps between rows/columns as well as the internal
padding for a cell.
See also:
• Working With Layouts in JavaFX - 06-2013
JavaFX HBox
JavaFX Pane
JavaFX Region
JavaFX ScrollPane
JavaFX SplitPane
JavaFX StackPane
In other UI environments, a StackPane shows a stack of top level containers where only one
container is shown at a time. In JavaFX, the StackPane is rather different. Instead, what we
have is the notion that ALL the children are shown simultaneously to each other overlayed upon
each other. I haven't actually found a great use for this however we can make the StackPane
behave as we supposed it might quite easily. If we make the immediate children of StackPane
containers then we can set the visibility property of those containers to false in all cases other than
the one container we want to make visible.
One useful routine to work in this are is as follows:
public static void setChildVisible(String name, Pane parent) {
for (Node child: parent.getChildren()) {
child.setVisible(name.equals(child.getId()));
} // End of for loop
} // End of setChildVisible
JavaFX TabPane
The TabPane is a container for multiple tabs. A tab is created by adding a Tab object into the list of
tabs returned by getTabs().
Page 282
Kommentare zu diesen Handbüchern