Advertisement
Guest User

Untitled

a guest
Dec 6th, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. package sample;
  2.  
  3. import javafx.application.Application;
  4. import javafx.fxml.FXMLLoader;
  5. import javafx.scene.Parent;
  6. import javafx.scene.Scene;
  7. import javafx.scene.control.Button;
  8. import javafx.scene.layout.*;
  9. import javafx.scene.layout.StackPane;
  10. import javafx.stage.Stage;
  11.  
  12. public class Main extends Application {
  13.  
  14. @Override
  15. public void start(Stage primaryStage) throws Exception{
  16. // HBox root = new HBox(); // ROOT ER HBox
  17. // BorderPane root = new BorderPane();
  18. GridPane root = new GridPane();
  19. Scene scene = new Scene(root);
  20.  
  21. Button btn1 = new Button("Knapp1");
  22. Button btn2 = new Button("Knapp2");
  23. Button btn3 = new Button("Knapp3");
  24. Button btn4 = new Button("Knapp4");
  25. Button btn5 = new Button("Knapp5");
  26. Button btn6 = new Button("Knapp6");
  27.  
  28. root.add(btn1,0,0);
  29. root.add(btn2,1,0);
  30. root.add(btn3,2,0);
  31. root.add(btn4,2,1);
  32. root.add(btn5,2,2);
  33. root.add(btn6,0,1,2,2);
  34.  
  35. /* VBox høyreKnapper = new VBox(btn4,btn5);
  36. root.setRight(høyreKnapper);
  37. HBox topKnapper = new HBox(btn1,btn2,btn3);
  38. root.setTop(topKnapper);
  39. root.setCenter(btn6);*/
  40. btn6.setMinSize(120,50);
  41.  
  42. /*VBox vbox1,vbox2;
  43. btn6.setMinSize(120,50);
  44. HBox enHboxTil = new HBox(btn1,btn2);
  45. vbox1 = new VBox(enHboxTil,btn6); //
  46. vbox2 = new VBox(btn3,btn4,btn5);*/
  47.  
  48.  
  49.  
  50.  
  51.  
  52. primaryStage.setScene(scene);
  53. primaryStage.show();
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60. }
  61.  
  62.  
  63. public static void main(String[] args) {
  64. launch(args);
  65. }
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement