Advertisement
Guest User

Untitled

a guest
Nov 13th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. package lab9;
  2.  
  3. import javafx.application.Application;
  4. import javafx.geometry.Pos;
  5. import javafx.scene.Scene;
  6. import javafx.scene.layout.VBox;
  7. import javafx.scene.control.Label;
  8. import javafx.scene.control.Button;
  9. import javafx.stage.Stage;
  10.  
  11. public class FirtstFx extends Application {
  12.  
  13. public static void main(String[] args) {
  14. Application.launch(args);
  15.  
  16.  
  17. }
  18. @Override
  19. public void start(Stage stage) {
  20. int ACM = 0;
  21. int RM = 0;
  22. String lastScorer = "N/A";
  23. String winner = "Draw";
  24.  
  25.  
  26. VBox root = new VBox();
  27. root.setAlignment(Pos.CENTER);
  28. root.setSpacing(10);
  29. Label lbl1 = new Label("Result: " + ACM + " X " + RM);
  30. Label lbl2 = new Label("Last Scorer: " + lastScorer);
  31. Label lbl3 = new Label("Winner: " + winner);
  32. Button realmadrid = new Button("Real Madrid");
  33. Button acmilan = new Button("AC Milan");
  34.  
  35. root.getChildren().add(acmilan);
  36. root.getChildren().add(realmadrid);
  37. root.getChildren().add(lbl1);
  38. root.getChildren().add(lbl2);
  39. root.getChildren().add(lbl3);
  40.  
  41. Scene scene = new Scene(root);
  42.  
  43. stage.setX(0);
  44. stage.setY(0);
  45. stage.setMinHeight(200);
  46. stage.setMinWidth(200);
  47. stage.setScene(scene);
  48. stage.setTitle("The Match");
  49. stage.show();
  50.  
  51.  
  52.  
  53. }
  54.  
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement