Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package lab9;
- import javafx.application.Application;
- import javafx.geometry.Pos;
- import javafx.scene.Scene;
- import javafx.scene.layout.VBox;
- import javafx.scene.control.Label;
- import javafx.scene.control.Button;
- import javafx.stage.Stage;
- public class FirtstFx extends Application {
- public static void main(String[] args) {
- Application.launch(args);
- }
- @Override
- public void start(Stage stage) {
- int ACM = 0;
- int RM = 0;
- String lastScorer = "N/A";
- String winner = "Draw";
- VBox root = new VBox();
- root.setAlignment(Pos.CENTER);
- root.setSpacing(10);
- Label lbl1 = new Label("Result: " + ACM + " X " + RM);
- Label lbl2 = new Label("Last Scorer: " + lastScorer);
- Label lbl3 = new Label("Winner: " + winner);
- Button realmadrid = new Button("Real Madrid");
- Button acmilan = new Button("AC Milan");
- root.getChildren().add(acmilan);
- root.getChildren().add(realmadrid);
- root.getChildren().add(lbl1);
- root.getChildren().add(lbl2);
- root.getChildren().add(lbl3);
- Scene scene = new Scene(root);
- stage.setX(0);
- stage.setY(0);
- stage.setMinHeight(200);
- stage.setMinWidth(200);
- stage.setScene(scene);
- stage.setTitle("The Match");
- stage.show();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement