From e70030b0d59ede808893e26ffebe06c2a98539b7 Mon Sep 17 00:00:00 2001 From: fdai6040 Date: Tue, 7 Feb 2023 12:41:19 +0100 Subject: [PATCH] TicTacToeGame message game over changed to "you lost" --- src/main/java/src/TicTacToeGame.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/src/TicTacToeGame.java b/src/main/java/src/TicTacToeGame.java index 64f04a8..a96ad41 100644 --- a/src/main/java/src/TicTacToeGame.java +++ b/src/main/java/src/TicTacToeGame.java @@ -86,7 +86,7 @@ public class TicTacToeGame implements ActionListener { { chance_flag = 0; Object[] option={"Restart","Exit"}; - int n=JOptionPane.showOptionDialog(frame, "Game Over\n"+s,"Game Over", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, option, option[0]); + int n=JOptionPane.showOptionDialog(frame, "You lost!\n"+s,"Game Over", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, option, option[0]); if(n==0) { frame.dispose(); @@ -165,7 +165,9 @@ public class TicTacToeGame implements ActionListener { } else if (chance_flag==9) { textfield.setText("Game Draw :)"); gameOver("Game Draw"); - } else if ((bton[3].getText()== "O") && (bton[4].getText() == "O") && (bton[5].getText() == "O")) + } + + else if ((bton[3].getText()== "O") && (bton[4].getText() == "O") && (bton[5].getText() == "O")) oWin(3,4,5); }