-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMView.java
46 lines (35 loc) · 1.04 KB
/
MView.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import java.awt.*;
import java.awt.event.*;
// machine view for displaying the state of a machine player
class MView extends MLayout implements IDisplay {
MView(String name) { super(name); }
// ------------------------------------------------------------------
public void sumDisplay(int s) {
sump.setText(sums(s));
}
public void msgDisplay(String s) {
msgp.setText(s);
}
// ------------------------------------------------------------------
// Examples:
static MView v1;
static public void createExamples() {
v1 = new MView("matthew");
}
// ------------------------------------------------------------------
// Test
static void main(String argv[]) {
try {
Robot r = new Robot();
v1.sumDisplay(77);
v1.msgDisplay("77");
// just to show what one can test
System.out.println("Check for seventy-seven (77)");
r.setAutoDelay(3000);
v1.quit(r);
}
catch (AWTException e) {
System.out.println("awt exception thrown");
};
}
}