Game closes on completion, more GUI

This commit is contained in:
Brandon Jackson 2015-11-03 19:06:20 -06:00
parent 92c2d839ba
commit f9949ac01e

View file

@ -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;
}