From f9949ac01ea2f8c412bc54f9cf0de9e0af1a2e96 Mon Sep 17 00:00:00 2001 From: Brandon Jackson <1drummer@att.net> Date: Tue, 3 Nov 2015 19:06:20 -0600 Subject: [PATCH] Game closes on completion, more GUI --- Client.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Client.java b/Client.java index 1ef9ac8..162ac90 100755 --- a/Client.java +++ b/Client.java @@ -289,10 +289,6 @@ public class Client { in.read(b, 0, 256); String temp = String.valueOf(b).trim(); - //System.out.print(temp); - //setBoard(temp); - //window.drawBoard(temp); - String g = "GAME OVER"; char[] go = new char[9]; for(int x = 0; x < go.length; ++x) { @@ -314,6 +310,9 @@ public class Client { frame.setVisible(true); //userInput = stdIn.readLine(); userInput = JOptionPane.showInputDialog(frame, temp); + //while(!userInput.contains("1") || !userInput.contains("2")) { + // userInput = JOptionPane.showInputDialog(frame, temp); + //} output.println(userInput); String diff = "?"; @@ -335,6 +334,7 @@ public class Client { in.read(buffer, 0, 256); for(int i = 0; i < buffer.length; ++i) { if(Arrays.equals(Arrays.copyOfRange(buffer, i, i+9), go)) { + frame.dispatchEvent(new WindowEvent(frame, WindowEvent.WINDOW_CLOSING)); JOptionPane.showMessageDialog(null, "\nGAME OVER\n"); end = true; }