Question: ___________________________ Main.java Class ___________________________ package sample; import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.stage.Stage; public class Main extends Application { @Override public void
___________________________ Main.java Class ___________________________
package sample; import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.stage.Stage; public class Main extends Application { @Override public void start(Stage primaryStage) throws Exception { Parent root = FXMLLoader.load(getClass().getResource("sample.fxml")); primaryStage.setTitle("Tic Tac Toe"); primaryStage.setScene(new Scene(root, 300, 300)); primaryStage.show(); } public static void main(String[] args) { launch(args); } } ____________________________________________ Controller.java Class ____________________________________________ package sample; import javafx.application.Platform; import javafx.event.ActionEvent; import javafx.fxml.FXML; import javafx.scene.control.Button; import javafx.scene.control.Label; public class Controller { @FXML private Label setPlayer; @FXML private Button button1, button2, button3, button4, button5, button6, button7, button8, button9, button0, button00; boolean player = true; public void exitButton(ActionEvent actionEvent) { Platform.exit(); } public void gamePlay (ActionEvent play) { if() } } ______________________________________________ sample.fxml Class ______________________________________________
Create a new JavaFX application in IntelliJ and namet program8 FirstName LastName. Edit your TicTacToe program to include the following modifications 1. Create a timer that will automatically switch which player's turn it is every 15 seconds. Your program should include a countdown indicator 2. An error message should appear in the form of a popup window if a player attempts to click on a button that already has an X or O in it 3. The game should recognize when a player has won. When a series of three X's or O's are in the correct pattern to win the game: a. The game area should become unplayable. b. The timer should stop c. A message should appear that corectly declares the winner and instructs the players to click the Reset button to start the game over d. The winning combination of buttons should be changed to have a red background. 4. The reset button should also restart the timer. 5. Your program's interface should be well formatted and laid out in o 6. I will expect visual enhancements such as backgrounds and font 7. You will also need to find a way to include the separation lines between manner that is intuitive and pleasing to the user. changes. the buttons/images on the game area. (i.e. the # sign that makes up a tic-tac-toe board) Create a new JavaFX application in IntelliJ and namet program8 FirstName LastName. Edit your TicTacToe program to include the following modifications 1. Create a timer that will automatically switch which player's turn it is every 15 seconds. Your program should include a countdown indicator 2. An error message should appear in the form of a popup window if a player attempts to click on a button that already has an X or O in it 3. The game should recognize when a player has won. When a series of three X's or O's are in the correct pattern to win the game: a. The game area should become unplayable. b. The timer should stop c. A message should appear that corectly declares the winner and instructs the players to click the Reset button to start the game over d. The winning combination of buttons should be changed to have a red background. 4. The reset button should also restart the timer. 5. Your program's interface should be well formatted and laid out in o 6. I will expect visual enhancements such as backgrounds and font 7. You will also need to find a way to include the separation lines between manner that is intuitive and pleasing to the user. changes. the buttons/images on the game area. (i.e. the # sign that makes up a tic-tac-toe board)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
