document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. import javafx.application.Application;
  2. import javafx.geometry.Insets;
  3. import javafx.scene.Scene;
  4. import javafx.scene.control.Button;
  5. import javafx.scene.layout.BorderPane;
  6.  
  7. import javafx.stage.Stage;
  8. /**
  9. *
  10. * @author zoranpavlovic.blogspot.com
  11. */
  12. public class BorderPaneMain extends Application {
  13. /**
  14. * @param args the command line arguments
  15. */
  16. public static void main(String[] args) {
  17. Application.launch(args);
  18. }
  19. @Override
  20. public void start(Stage primaryStage) {
  21. primaryStage.setTitle("BorderPane Test");
  22.  
  23. //Creating BorderPane
  24. BorderPane bp = new BorderPane();
  25. bp.setPadding(new Insets(10, 20, 10, 20));
  26.  
  27. //Adding buttons to BorderPane
  28. Button btnTop = new Button("Top");
  29. bp.setTop(btnTop);
  30.  
  31. Button btnLeft = new Button("Left");
  32. bp.setLeft(btnLeft);
  33.  
  34. Button btnCenter = new Button("Center");
  35. bp.setCenter(btnCenter);
  36.  
  37. Button btnRight = new Button("Right");
  38. bp.setRight(btnRight);
  39.  
  40. Button btnBottom = new Button("Bottom");
  41. bp.setBottom(btnBottom);
  42.  
  43. //Adding BorderPane to the scene
  44. Scene scene = new Scene(bp,300,200);
  45. primaryStage.setScene(scene);
  46. primaryStage.show();
  47. }
  48. }
');