Created
July 29, 2020 12:48
-
-
Save MichaelNgogoyo/6b21028b5a4a0b9b73d02643d7e1f496 to your computer and use it in GitHub Desktop.
Tic Tac Toe
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Tic.Tac.Toe { | |
requires javafx.web; | |
requires javafx.media; | |
requires javafx.graphics; | |
requires javafx.fxml; | |
requires javafx.controls; | |
requires javafx.base; | |
requires javafx.swt; | |
opens sample; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package sample; | |
import java.net.URL; | |
import java.util.Optional; | |
import java.util.ResourceBundle; | |
import javafx.application.Platform; | |
import javafx.event.ActionEvent; | |
import javafx.event.EventHandler; | |
import javafx.fxml.FXML; | |
import javafx.fxml.Initializable; | |
import javafx.scene.control.Alert; | |
import javafx.scene.control.Button; | |
import javafx.scene.control.ButtonType; | |
import javafx.scene.control.Label; | |
import javafx.scene.paint.Color; | |
import org.w3c.dom.events.MouseEvent; | |
public class Controller implements Initializable{ | |
private String startGame = "X"; | |
private int Xcount = 0; | |
private int Ocount = 0; | |
@FXML | |
private Label lblCountX; | |
@FXML | |
private Label lblCountO; | |
@FXML | |
private Button btn1; | |
@FXML | |
private Button btn2; | |
@FXML | |
private Button btn3; | |
@FXML | |
private Button btn4; | |
@FXML | |
private Button btn5; | |
@FXML | |
private Button btn6; | |
@FXML | |
private Button btn7; | |
@FXML | |
private Button btn8; | |
@FXML | |
private Button btn9; | |
@FXML | |
private Button btnX; | |
@FXML | |
private Button btnO; | |
@FXML | |
private Button btnReset; | |
@FXML | |
private Button btnExit; | |
@Override | |
public void initialize(URL arg0, ResourceBundle arg1) { | |
// gameScore(); | |
} | |
@FXML | |
public void handleExit() { | |
Alert alert = new Alert(Alert.AlertType.CONFIRMATION); | |
alert.setTitle("Exit"); | |
alert.setHeaderText("Do you want to exit"); | |
Optional<ButtonType> result = alert.showAndWait(); | |
if(result.isPresent() && result.get() == ButtonType.OK) { | |
Platform.exit(); | |
} | |
} | |
public void gameScore() { | |
lblCountX.setText(String.valueOf(Xcount)); | |
lblCountO.setText(String.valueOf(Ocount)); | |
} | |
public void choosePlayer() { | |
if(startGame.equalsIgnoreCase("X")) { | |
startGame="O"; | |
}else { | |
startGame = "X"; | |
} | |
} | |
@FXML | |
public void handleReset() { | |
btn2.setText(null); | |
btn1.setText(null); | |
btn3.setText(null); | |
btn4.setText(null); | |
btn5.setText(null); | |
btn6.setText(null); | |
btn7.setText(null); | |
btn8.setText(null); | |
btn9.setText(null); | |
// btn1.setStyle("-fx-background-color: MediumSeaGreen"); | |
} | |
public void winningGame(){ | |
String b1 = btn1.getText(); | |
String b2 = btn2.getText(); | |
String b3 = btn3.getText(); | |
String b4 = btn4.getText(); | |
String b5 = btn5.getText(); | |
String b6 = btn6.getText(); | |
String b7 = btn7.getText(); | |
String b8 = btn8.getText(); | |
String b9 = btn9.getText(); | |
/** XXXXXXXXXXXXXXXXXXXXXXXXXXXX */ | |
if (b1==("X") && b2==("X") && b3==("X")){ | |
Alert alert = new Alert(Alert.AlertType.INFORMATION); | |
alert.setContentText("Player X wins"); | |
Optional<ButtonType> result = alert.showAndWait(); | |
if (result.isPresent() && result.get() == ButtonType.OK){ | |
Xcount++; | |
gameScore(); | |
handleReset(); | |
} | |
} | |
if (b4==("X") && b6==("X") && b5==("X")){ | |
Alert alert = new Alert(Alert.AlertType.INFORMATION); | |
alert.setContentText("Player X wins"); | |
Optional<ButtonType> result = alert.showAndWait(); | |
if (result.isPresent() && result.get() == ButtonType.OK){ | |
Xcount++; | |
gameScore(); | |
handleReset(); | |
} | |
} | |
if (b3==("X") && b4==("X") && b5==("X")){ | |
Alert alert = new Alert(Alert.AlertType.INFORMATION); | |
alert.setContentText("Player X wins"); | |
Optional<ButtonType> result = alert.showAndWait(); | |
if (result.isPresent() && result.get() == ButtonType.OK){ | |
Xcount++; | |
gameScore(); | |
handleReset(); | |
} | |
} | |
if (b7==("X") && b8==("X") && b9==("X")){ | |
Alert alert = new Alert(Alert.AlertType.INFORMATION); | |
alert.setContentText("Player X wins"); | |
Optional<ButtonType> result = alert.showAndWait(); | |
if (result.isPresent() && result.get() == ButtonType.OK){ | |
Xcount++; | |
gameScore(); | |
handleReset(); | |
} | |
} | |
if (b1==("X") && b4==("X") && b7==("X")){ | |
Alert alert = new Alert(Alert.AlertType.INFORMATION); | |
alert.setContentText("Player X wins"); | |
Optional<ButtonType> result = alert.showAndWait(); | |
if (result.isPresent() && result.get() == ButtonType.OK){ | |
Xcount++; | |
gameScore(); | |
handleReset(); | |
} | |
} | |
if (b2==("X") && b5==("X") && b8==("X")){ | |
Alert alert = new Alert(Alert.AlertType.INFORMATION); | |
alert.setContentText("Player X wins"); | |
Optional<ButtonType> result = alert.showAndWait(); | |
if (result.isPresent() && result.get() == ButtonType.OK){ | |
Xcount++; | |
gameScore(); | |
handleReset(); | |
} | |
} | |
if (b3==("X") && b6==("X") && b9==("X")){ | |
Alert alert = new Alert(Alert.AlertType.INFORMATION); | |
alert.setContentText("Player X wins"); | |
Optional<ButtonType> result = alert.showAndWait(); | |
if (result.isPresent() && result.get() == ButtonType.OK){ | |
Xcount++; | |
gameScore(); | |
handleReset(); | |
} | |
} | |
if (b1==("X") && b5==("X") && b9==("X")){ | |
Alert alert = new Alert(Alert.AlertType.INFORMATION); | |
alert.setContentText("Player X wins"); | |
Optional<ButtonType> result = alert.showAndWait(); | |
if (result.isPresent() && result.get() == ButtonType.OK){ | |
Xcount++; | |
gameScore(); | |
handleReset(); | |
} | |
} | |
if (b3==("X") && b5==("X") && b7==("X")){ | |
Alert alert = new Alert(Alert.AlertType.INFORMATION); | |
alert.setContentText("Player X wins"); | |
Optional<ButtonType> result = alert.showAndWait(); | |
if (result.isPresent() && result.get() == ButtonType.OK){ | |
Xcount++; | |
gameScore(); | |
handleReset(); | |
} | |
} | |
/** OOOOOOOOOOOOOOOOOOOOOOOOOOOOOO*/ | |
if (b1==("O") && b2==("O") && b3==("O")){ | |
Alert alert = new Alert(Alert.AlertType.INFORMATION); | |
alert.setContentText("Player O wins"); | |
Optional<ButtonType> result = alert.showAndWait(); | |
if (result.isPresent() && result.get() == ButtonType.OK){ | |
Ocount++; | |
gameScore(); | |
handleReset(); | |
} | |
} | |
if (b3==("O") && b4==("O") && b5==("O")){ | |
Alert alert = new Alert(Alert.AlertType.INFORMATION); | |
alert.setContentText("Player O wins"); | |
Optional<ButtonType> result = alert.showAndWait(); | |
if (result.isPresent() && result.get() == ButtonType.OK){ | |
Ocount++; | |
gameScore(); | |
handleReset(); | |
} | |
} | |
if (b7==("O") && b8==("O") && b9==("O")){ | |
Alert alert = new Alert(Alert.AlertType.INFORMATION); | |
alert.setContentText("Player O wins"); | |
Optional<ButtonType> result = alert.showAndWait(); | |
if (result.isPresent() && result.get() == ButtonType.OK){ | |
Ocount++; | |
gameScore(); | |
handleReset(); | |
} | |
} | |
if (b1==("O") && b4==("O") && b7==("O")){ | |
Alert alert = new Alert(Alert.AlertType.INFORMATION); | |
alert.setContentText("Player O wins"); | |
Optional<ButtonType> result = alert.showAndWait(); | |
if (result.isPresent() && result.get() == ButtonType.OK){ | |
Ocount++; | |
gameScore(); | |
handleReset(); | |
} | |
} | |
if (b2==("O") && b5==("O") && b8==("O")){ | |
Alert alert = new Alert(Alert.AlertType.INFORMATION); | |
alert.setContentText("Player O wins"); | |
Optional<ButtonType> result = alert.showAndWait(); | |
if (result.isPresent() && result.get() == ButtonType.OK){ | |
Ocount++; | |
gameScore(); | |
handleReset(); | |
} | |
} | |
if (b3==("O") && b6==("O") && b9==("O")){ | |
Alert alert = new Alert(Alert.AlertType.INFORMATION); | |
alert.setContentText("Player O wins"); | |
Optional<ButtonType> result = alert.showAndWait(); | |
if (result.isPresent() && result.get() == ButtonType.OK){ | |
Ocount++; | |
gameScore(); | |
handleReset(); | |
} | |
} | |
if (b1==("O") && b5==("O") && b9==("O")){ | |
Alert alert = new Alert(Alert.AlertType.INFORMATION); | |
alert.setContentText("Player O wins"); | |
Optional<ButtonType> result = alert.showAndWait(); | |
if (result.isPresent() && result.get() == ButtonType.OK){ | |
Ocount++; | |
gameScore(); | |
handleReset(); | |
} | |
} | |
if (b3==("O") && b5==("O") && b7==("O")){ | |
Alert alert = new Alert(Alert.AlertType.INFORMATION); | |
alert.setContentText("Player O wins"); | |
Optional<ButtonType> result = alert.showAndWait(); | |
if (result.isPresent() && result.get() == ButtonType.OK){ | |
Ocount++; | |
gameScore(); | |
handleReset(); | |
} | |
} | |
if (b4==("O") && b5==("O") && b6==("O")){ | |
Alert alert = new Alert(Alert.AlertType.INFORMATION); | |
alert.setContentText("Player O wins"); | |
Optional<ButtonType> result = alert.showAndWait(); | |
if (result.isPresent() && result.get() == ButtonType.OK){ | |
Ocount++; | |
gameScore(); | |
handleReset(); | |
} | |
} | |
} | |
@FXML | |
public void handleButtons(){ | |
btn1.setOnAction(new EventHandler<ActionEvent>() { | |
@Override | |
public void handle(ActionEvent event) { | |
btn1.setText(startGame); | |
if (startGame.equalsIgnoreCase("X")){ | |
btn1.setTextFill(Color.RED); | |
}else{ | |
btn1.setTextFill(Color.BLUE); | |
} | |
choosePlayer(); | |
winningGame(); | |
} | |
}); | |
btn2.setOnAction(new EventHandler<ActionEvent>() { | |
@Override | |
public void handle(ActionEvent event) { | |
btn2.setText(startGame); | |
if (startGame.equalsIgnoreCase("X")){ | |
btn2.setTextFill(Color.RED); | |
}else{ | |
btn2.setTextFill(Color.BLUE); | |
} | |
choosePlayer(); | |
winningGame(); | |
} | |
}); | |
btn3.setOnAction(new EventHandler<ActionEvent>() { | |
@Override | |
public void handle(ActionEvent event) { | |
btn3.setText(startGame); | |
if (startGame.equalsIgnoreCase("X")){ | |
btn3.setTextFill(Color.RED); | |
}else{ | |
btn3.setTextFill(Color.BLUE); | |
} | |
choosePlayer(); | |
winningGame(); | |
} | |
}); | |
btn4.setOnAction(new EventHandler<ActionEvent>() { | |
@Override | |
public void handle(ActionEvent event) { | |
btn4.setText(startGame); | |
if (startGame.equalsIgnoreCase("X")){ | |
btn4.setTextFill(Color.RED); | |
}else{ | |
btn4.setTextFill(Color.BLUE); | |
} | |
choosePlayer(); | |
winningGame(); | |
} | |
}); | |
btn5.setOnAction(new EventHandler<ActionEvent>() { | |
@Override | |
public void handle(ActionEvent event) { | |
btn5.setText(startGame); | |
if (startGame.equalsIgnoreCase("X")){ | |
btn5.setTextFill(Color.RED); | |
}else{ | |
btn5.setTextFill(Color.BLUE); | |
} | |
choosePlayer(); | |
winningGame(); | |
} | |
}); | |
btn6.setOnAction(new EventHandler<ActionEvent>() { | |
@Override | |
public void handle(ActionEvent event) { | |
btn6.setText(startGame); | |
if (startGame.equalsIgnoreCase("X")){ | |
btn6.setTextFill(Color.RED); | |
}else{ | |
btn6.setTextFill(Color.BLUE); | |
} | |
choosePlayer(); | |
winningGame(); | |
} | |
}); | |
btn7.setOnAction(new EventHandler<ActionEvent>() { | |
@Override | |
public void handle(ActionEvent event) { | |
btn7.setText(startGame); | |
if (startGame.equalsIgnoreCase("X")){ | |
btn7.setTextFill(Color.RED); | |
}else{ | |
btn7.setTextFill(Color.BLUE); | |
} | |
choosePlayer(); | |
winningGame(); | |
} | |
}); | |
btn8.setOnAction(new EventHandler<ActionEvent>() { | |
@Override | |
public void handle(ActionEvent event) { | |
btn8.setText(startGame); | |
if (startGame.equalsIgnoreCase("X")){ | |
btn8.setTextFill(Color.RED); | |
}else{ | |
btn8.setTextFill(Color.BLUE); | |
} | |
choosePlayer(); | |
winningGame(); | |
} | |
}); | |
btn9.setOnAction(new EventHandler<ActionEvent>() { | |
@Override | |
public void handle(ActionEvent event) { | |
btn9.setText(startGame); | |
if (startGame.equalsIgnoreCase("X")){ | |
btn9.setTextFill(Color.RED); | |
}else{ | |
btn9.setTextFill(Color.BLUE); | |
} | |
choosePlayer(); | |
winningGame(); | |
} | |
}); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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("Hello World"); | |
primaryStage.setScene(new Scene(root, 900, 600)); | |
primaryStage.show(); | |
} | |
public static void main(String[] args) { | |
launch(args); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<?import javafx.scene.control.Button?> | |
<?import javafx.scene.layout.BorderPane?> | |
<?import javafx.scene.layout.ColumnConstraints?> | |
<?import javafx.scene.layout.GridPane?> | |
<?import javafx.scene.layout.RowConstraints?> | |
<GridPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/11.0.1"> | |
<columnConstraints> | |
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> | |
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> | |
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> | |
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> | |
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> | |
</columnConstraints> | |
<rowConstraints> | |
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> | |
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> | |
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> | |
</rowConstraints> | |
<children> | |
<BorderPane prefHeight="200.0" prefWidth="200.0"> | |
<center> | |
<Button mnemonicParsing="false" prefHeight="155.0" prefWidth="119.0" text="Button" BorderPane.alignment="CENTER" /> | |
</center> | |
</BorderPane> | |
<BorderPane prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="1" /> | |
<BorderPane prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="2" /> | |
<BorderPane prefHeight="200.0" prefWidth="200.0" GridPane.rowIndex="1" /> | |
<BorderPane prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="1" GridPane.rowIndex="1" /> | |
<BorderPane prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="2" GridPane.rowIndex="1" /> | |
<BorderPane prefHeight="200.0" prefWidth="200.0" GridPane.rowIndex="2" /> | |
<BorderPane prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="1" GridPane.rowIndex="2" /> | |
<BorderPane prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="2" GridPane.rowIndex="2" /> | |
<BorderPane prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="3" GridPane.rowIndex="2" /> | |
<BorderPane prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="4" GridPane.rowIndex="2" /> | |
<BorderPane prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="3" GridPane.rowIndex="1" /> | |
<BorderPane prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="4" GridPane.rowIndex="1" /> | |
<BorderPane prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="3" /> | |
<BorderPane prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="4" /> | |
</children> | |
</GridPane> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<?import javafx.scene.control.Button?> | |
<?import javafx.scene.control.Label?> | |
<?import javafx.scene.layout.BorderPane?> | |
<?import javafx.scene.layout.ColumnConstraints?> | |
<?import javafx.scene.layout.GridPane?> | |
<?import javafx.scene.layout.HBox?> | |
<?import javafx.scene.layout.RowConstraints?> | |
<?import javafx.scene.layout.VBox?> | |
<?import javafx.scene.text.Font?> | |
<BorderPane xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" | |
fx:controller="sample.Controller"> | |
<center> | |
<HBox> | |
<GridPane> | |
<columnConstraints> | |
<ColumnConstraints hgrow="ALWAYS"/> | |
<ColumnConstraints hgrow="ALWAYS"/> | |
<ColumnConstraints hgrow="ALWAYS"/> | |
<ColumnConstraints hgrow="ALWAYS"/> | |
<ColumnConstraints hgrow="ALWAYS"/> | |
</columnConstraints> | |
<rowConstraints> | |
<RowConstraints vgrow="ALWAYS"/> | |
<RowConstraints vgrow="ALWAYS"/> | |
<RowConstraints vgrow="ALWAYS"/> | |
</rowConstraints> | |
<children> | |
<BorderPane prefHeight="200.0" prefWidth="200.0"> | |
<center> | |
<Button fx:id="btn1" alignment="CENTER" contentDisplay="CENTER" mnemonicParsing="false" | |
onMouseClicked="#handleButtons" prefHeight="198.0" prefWidth="212.0" | |
BorderPane.alignment="CENTER"> | |
<font> | |
<Font name="System Bold" size="57.0"/> | |
</font> | |
</Button> | |
</center> | |
</BorderPane> | |
<BorderPane prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="1"> | |
<center> | |
<Button fx:id="btn2" alignment="CENTER" contentDisplay="CENTER" mnemonicParsing="false" | |
onAction="#handleButtons" prefHeight="202.0" prefWidth="204.0" | |
BorderPane.alignment="CENTER"> | |
<font> | |
<Font name="System Bold" size="57.0"/> | |
</font> | |
</Button> | |
</center> | |
</BorderPane> | |
<BorderPane prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="2"> | |
<center> | |
<Button fx:id="btn3" alignment="CENTER" contentDisplay="CENTER" mnemonicParsing="false" | |
onAction="#handleButtons" prefHeight="212.0" prefWidth="244.0" | |
BorderPane.alignment="CENTER"> | |
<font> | |
<Font name="System Bold" size="57.0"/> | |
</font> | |
</Button> | |
</center> | |
</BorderPane> | |
<BorderPane prefHeight="200.0" prefWidth="200.0" GridPane.rowIndex="1"> | |
<center> | |
<Button fx:id="btn4" alignment="CENTER" contentDisplay="CENTER" mnemonicParsing="false" | |
onAction="#handleButtons" onMouseClicked="#handleButtons" prefHeight="201.0" | |
prefWidth="230.0" BorderPane.alignment="CENTER"> | |
<font> | |
<Font name="System Bold" size="57.0"/> | |
</font> | |
</Button> | |
</center> | |
</BorderPane> | |
<BorderPane prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="1" GridPane.rowIndex="1"> | |
<center> | |
<Button fx:id="btn5" alignment="CENTER" contentDisplay="CENTER" mnemonicParsing="false" | |
onAction="#handleButtons" prefHeight="206.0" prefWidth="214.0" | |
BorderPane.alignment="CENTER"> | |
<font> | |
<Font name="System Bold" size="57.0"/> | |
</font> | |
</Button> | |
</center> | |
</BorderPane> | |
<BorderPane prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="2" GridPane.rowIndex="1"> | |
<bottom> | |
<Button fx:id="btn6" alignment="CENTER" contentDisplay="CENTER" mnemonicParsing="false" | |
onMouseClicked="#handleButtons" prefHeight="201.0" prefWidth="202.0" | |
BorderPane.alignment="CENTER"> | |
<font> | |
<Font name="System Bold" size="57.0"/> | |
</font> | |
</Button> | |
</bottom> | |
</BorderPane> | |
<BorderPane prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="3" GridPane.rowIndex="1"> | |
<center> | |
<Button fx:id="btnX" alignment="CENTER" mnemonicParsing="false" prefHeight="213.0" | |
prefWidth="220.0" text="Player X:" BorderPane.alignment="CENTER"> | |
<font> | |
<Font name="Aharoni Bold" size="26.0"/> | |
</font> | |
</Button> | |
</center> | |
</BorderPane> | |
<BorderPane prefHeight="200.0" prefWidth="200.0" GridPane.rowIndex="2"> | |
<center> | |
<Button fx:id="btn7" alignment="CENTER" contentDisplay="CENTER" mnemonicParsing="false" | |
onAction="#handleButtons" prefHeight="199.0" prefWidth="238.0" | |
BorderPane.alignment="CENTER"> | |
<font> | |
<Font name="System Bold" size="57.0"/> | |
</font> | |
</Button> | |
</center> | |
</BorderPane> | |
<BorderPane prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="1" GridPane.rowIndex="2"> | |
<center> | |
<Button fx:id="btn8" alignment="CENTER" contentDisplay="CENTER" mnemonicParsing="false" | |
onAction="#handleButtons" prefHeight="213.0" prefWidth="239.0" | |
BorderPane.alignment="CENTER"> | |
<font> | |
<Font name="System Bold" size="57.0"/> | |
</font> | |
</Button> | |
</center> | |
</BorderPane> | |
<BorderPane prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="2" GridPane.rowIndex="2"> | |
<center> | |
<Button fx:id="btn9" alignment="CENTER" contentDisplay="CENTER" mnemonicParsing="false" | |
onAction="#handleButtons" prefHeight="203.0" prefWidth="222.0" | |
BorderPane.alignment="CENTER"> | |
<font> | |
<Font name="System Bold" size="57.0"/> | |
</font> | |
</Button> | |
</center> | |
</BorderPane> | |
<BorderPane prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="3" GridPane.rowIndex="2"> | |
<center> | |
<Button fx:id="btnReset" alignment="CENTER" contentDisplay="CENTER" | |
mnemonicParsing="false" onAction="#handleReset" prefHeight="208.0" | |
prefWidth="194.0" text="RESET" textOverrun="CENTER_ELLIPSIS" | |
BorderPane.alignment="CENTER"> | |
<font> | |
<Font name="System Bold" size="22.0"/> | |
</font> | |
</Button> | |
</center> | |
</BorderPane> | |
<BorderPane prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="4" GridPane.rowIndex="2"> | |
<center> | |
<Button fx:id="btnExit" alignment="CENTER" contentDisplay="CENTER" | |
mnemonicParsing="false" onAction="#handleExit" prefHeight="202.0" | |
prefWidth="199.0" text="EXIT" textOverrun="CENTER_ELLIPSIS" | |
BorderPane.alignment="CENTER"> | |
<font> | |
<Font name="System Bold" size="22.0"/> | |
</font> | |
</Button> | |
</center> | |
</BorderPane> | |
<BorderPane prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="3"> | |
<center> | |
<Button fx:id="btn0" alignment="CENTER" mnemonicParsing="false" prefHeight="200.0" | |
prefWidth="207.0" text="Player O:" BorderPane.alignment="CENTER"> | |
<font> | |
<Font name="Aharoni Bold" size="25.0"/> | |
</font> | |
</Button> | |
</center> | |
</BorderPane> | |
<BorderPane prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="4" GridPane.rowIndex="1"> | |
<center> | |
<Label fx:id="lblCountX" prefHeight="223.0" prefWidth="200.0" text=" " | |
BorderPane.alignment="CENTER"> | |
<font> | |
<Font name="System Italic" size="35.0"/> | |
</font> | |
</Label> | |
</center> | |
</BorderPane> | |
<BorderPane prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="4"> | |
<center> | |
<Label fx:id="lblCountO" prefHeight="221.0" prefWidth="210.0" | |
BorderPane.alignment="CENTER"> | |
<font> | |
<Font name="System Italic" size="35.0"/> | |
</font> | |
</Label> | |
</center> | |
</BorderPane> | |
</children> | |
</GridPane> | |
<VBox HBox.hgrow="ALWAYS"> | |
</VBox> | |
</HBox> | |
</center> | |
<!-- <top>--> | |
<!-- </top>--> | |
</BorderPane> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment