Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package sample;
- import javafx.application.Application;
- import javafx.scene.control.*;
- import javafx.scene.layout.GridPane;
- import javafx.scene.Scene;
- import javafx.stage.Stage;
- import sample.edu.missouriwestern.cpozo.monsters.*;
- import java.util.ArrayList;
- public class Main extends Application {
- public static Label player1 = new Label("First Combatant");
- public static Label player2 = new Label("Second Combatant");
- public static RadioButton warrior1 = new RadioButton("Warrior");
- public static RadioButton warrior2 = new RadioButton("Warrior");
- public static RadioButton Human1 = new RadioButton("Human");
- public static RadioButton Human2 = new RadioButton("Human");
- public static RadioButton ninja1 = new RadioButton("Ninja");
- public static RadioButton ninja2 = new RadioButton("Ninja");
- public static RadioButton Rabbit1 = new RadioButton("Rabbit");
- public static RadioButton Rabbit2 = new RadioButton("Rabbit");
- public static Button Play = new Button("Fight!");
- public static Button Reset = new Button("Start a new fight");
- public static TextArea playbyplaybox = new TextArea("");
- public static Label CombatantA = new Label("Combatant A");
- public static TextField textFieldA = new TextField();
- public static Label CombatantB = new Label("Combatant B");
- public static TextField textFieldB = new TextField();
- @Override
- public void start(Stage primaryStage) throws Exception {
- GridPane root = new GridPane();
- root.setHgap(5.0);
- root.setVgap(10.0);
- root.add(player1, 3, 1);
- root.add(player2, 4, 1);
- root.add(warrior1, 3, 2);
- root.add(warrior2, 4, 2);
- root.add(Human1, 3, 3);
- root.add(Human2, 4, 3);
- root.add(ninja1, 3, 4);
- root.add(ninja2, 4, 4);
- root.add(Rabbit1, 3, 5);
- root.add(Rabbit2, 4, 5);
- root.add(Play, 3, 20);
- root.add(Reset, 4, 20);
- root.add(CombatantA, 3, 7);
- root.add(textFieldA, 4, 7);
- root.add(CombatantB, 3, 8);
- root.add(textFieldB, 4, 8);
- root.add(playbyplaybox, 3, 10, 2, 5);
- primaryStage.setTitle("Monster Game");
- primaryStage.setScene(new Scene(root, 600, 600));
- primaryStage.show();
- }
- public static void main(String[] args) {
- launch(args);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement