Java Reference
In-Depth Information
Create a simple form designer application to manipulate the user interface dynamically
using the JavaFX's javafx.scene.layout.GridPane . The form designer ap-
plication will have the following features:
It will toggle the display of the grid layout's grid lines for debugging.
It will adjust the top padding of the GridPane .
It will adjust the left padding of the GridPane .
It will adjust the horizontal gap between cells in the GridPane .
It will adjust the vertical gap between cells in the GridPane .
It will align controls within cells horizontally.
It will align controls within cells vertically.
The following code is the main launching point for the form designer application:
public class ManipulatingLayoutViaGrids extends
Application {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Application.launch(args);
}
@Override
public void start(Stage primaryStage) {
primaryStage.setTitle("Chapter 15-4 Manipulating
Layout via Grids ");
Group root = new Group();
Scene scene = new Scene(root, 640, 480,
Color.WHITE);
// Left and right split pane
SplitPane splitPane = new SplitPane();
splitPane.prefWidthProperty().bind(scene.widthProperty());
splitPane.prefHeightProperty().bind(scene.heightProperty());
Search WWH ::




Custom Search