Game closes on completion, more GUI
This commit is contained in:
parent
92c2d839ba
commit
f9949ac01e
1 changed files with 4 additions and 4 deletions
|
@ -289,10 +289,6 @@ public class Client {
|
||||||
in.read(b, 0, 256);
|
in.read(b, 0, 256);
|
||||||
|
|
||||||
String temp = String.valueOf(b).trim();
|
String temp = String.valueOf(b).trim();
|
||||||
//System.out.print(temp);
|
|
||||||
//setBoard(temp);
|
|
||||||
//window.drawBoard(temp);
|
|
||||||
|
|
||||||
String g = "GAME OVER";
|
String g = "GAME OVER";
|
||||||
char[] go = new char[9];
|
char[] go = new char[9];
|
||||||
for(int x = 0; x < go.length; ++x) {
|
for(int x = 0; x < go.length; ++x) {
|
||||||
|
@ -314,6 +310,9 @@ public class Client {
|
||||||
frame.setVisible(true);
|
frame.setVisible(true);
|
||||||
//userInput = stdIn.readLine();
|
//userInput = stdIn.readLine();
|
||||||
userInput = JOptionPane.showInputDialog(frame, temp);
|
userInput = JOptionPane.showInputDialog(frame, temp);
|
||||||
|
//while(!userInput.contains("1") || !userInput.contains("2")) {
|
||||||
|
// userInput = JOptionPane.showInputDialog(frame, temp);
|
||||||
|
//}
|
||||||
output.println(userInput);
|
output.println(userInput);
|
||||||
|
|
||||||
String diff = "?";
|
String diff = "?";
|
||||||
|
@ -335,6 +334,7 @@ public class Client {
|
||||||
in.read(buffer, 0, 256);
|
in.read(buffer, 0, 256);
|
||||||
for(int i = 0; i < buffer.length; ++i) {
|
for(int i = 0; i < buffer.length; ++i) {
|
||||||
if(Arrays.equals(Arrays.copyOfRange(buffer, i, i+9), go)) {
|
if(Arrays.equals(Arrays.copyOfRange(buffer, i, i+9), go)) {
|
||||||
|
frame.dispatchEvent(new WindowEvent(frame, WindowEvent.WINDOW_CLOSING));
|
||||||
JOptionPane.showMessageDialog(null, "\nGAME OVER\n");
|
JOptionPane.showMessageDialog(null, "\nGAME OVER\n");
|
||||||
end = true;
|
end = true;
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue