Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javafx.application.Application;
- import javafx.geometry.Insets;
- import javafx.scene.Scene;
- import javafx.scene.control.Button;
- import javafx.scene.layout.BorderPane;
- import javafx.stage.Stage;
- /**
- *
- * @author zoranpavlovic.blogspot.com
- */
- public class BorderPaneMain 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("BorderPane Test");
- //Creating BorderPane
- BorderPane bp = new BorderPane();
- bp.setPadding(new Insets(10, 20, 10, 20));
- //Adding buttons to BorderPane
- Button btnTop = new Button("Top");
- bp.setTop(btnTop);
- Button btnLeft = new Button("Left");
- bp.setLeft(btnLeft);
- Button btnCenter = new Button("Center");
- bp.setCenter(btnCenter);
- Button btnRight = new Button("Right");
- bp.setRight(btnRight);
- Button btnBottom = new Button("Bottom");
- bp.setBottom(btnBottom);
- //Adding BorderPane to the scene
- Scene scene = new Scene(bp,300,200);
- primaryStage.setScene(scene);
- primaryStage.show();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement