Less console, more GUI

This commit is contained in:
Brandon Jackson 2015-11-03 18:40:05 -06:00
parent c807d75e14
commit 02cf0fc031

View file

@ -1,4 +1,4 @@
// Alex Huddleston
// Alex Huddleston & Brandon Jackson
// Breakthrough Client in Java
import java.io.IOException;
@ -312,7 +312,8 @@ public class Client {
frame.pack();
frame.setMinimumSize(frame.getSize());
frame.setVisible(true);
userInput = stdIn.readLine();
//userInput = stdIn.readLine();
userInput = JOptionPane.showInputDialog(frame, temp);
output.println(userInput);
String diff = "?";
@ -320,9 +321,10 @@ public class Client {
temp = String.valueOf(b).trim();
System.out.print(temp);
while(!diff.equals("EASY") && !diff.equals("MEDIUM") && !diff.equals("HARD")) {
diff = stdIn.readLine();
diff = JOptionPane.showInputDialog(frame, temp);//diff = stdIn.readLine();
diff = diff.toUpperCase();
if(!diff.equals("EASY") && !diff.equals("MEDIUM") && !diff.equals("HARD")) {
System.out.print(diff + "\nInvalid difficulty.\n" + temp);
JOptionPane.showMessageDialog(null, diff + "\nInvalid difficulty.\n" + temp);
}
}
output.println(userInput);
@ -333,6 +335,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)) {
JOptionPane.showMessageDialog(null, "\nGAME OVER\n");
end = true;
}
}
@ -369,4 +372,4 @@ public class Client {
System.err.println("IOException: " + e.getMessage());
}
}
}
}