Java Reference
In-Depth Information
HBox hbox = new HBox();
hbox.getChildren().add(splitPane);
root.getChildren().add(hbox);
primaryStage.setScene(scene);
primaryStage.show();
}
Figure 14-14 depicts the application using split pane controls.
Figure 14-14 . Split views
How It Works
If you've ever seen a simple RSS reader or the Javadocs, you'll notice that the screen is
divided into sections with dividers. This recipe creates three areas—the left, upper
right, and lower right.
You begin by creating a SplitPane that divides the left from the right area of the
scene. Then you bind its width and height properties to the scene so the areas will take
up the available space as the user resizes the stage. Next, you create a VBox layout
control representing the left area. In the VBox ( leftArea ), you loop to generate a
series of Text nodes. Next, generate the right side of the split pane. The following
code snippet allows the split pane control ( SplitPane ) to divide horizontally:
 
 
Search WWH ::




Custom Search