public class BorderPaneDemo extends Application
1: import javafx.application.Application;
2: import javafx.scene.Scene;
3: import javafx.stage.Stage;
4: import javafx.scene.layout.BorderPane;
5: import javafx.scene.control.Button;
6: /**
7: Simple demonstration of adding buttons to the BorderPane layout.
8: */
9: public class BorderPaneDemo extends Application
10: {
11: public static void main(String[] args)
12: {
13: launch(args);
14: }
15:
16: @Override
17: public void start(Stage primaryStage) throws Exception
18: {
19: BorderPane root = new BorderPane();
20:
21: root.setTop(new Button("Top Button"));
22: root.setLeft(new Button("Left Button"));
23: root.setCenter(new Button("Center Button"));
24: root.setRight(new Button("Right Button"));
25: root.setBottom(new Button("Bottom Button"));
26:
27: Scene scene = new Scene(root, 500, 200);
28: primaryStage.setTitle("BorderPane Demo");
29: primaryStage.setScene(scene);
30: primaryStage.show();
31: }
32: }