-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGUI.java
55 lines (32 loc) · 861 Bytes
/
GUI.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
47
48
49
50
51
52
53
54
55
// top-level class for graphical output
import javax.swing.*;
import java.awt.*;
public class GUI extends Output {
private WFrame frame;
public GUI() {
super();
frame=new WFrame();
animator.resume();
} //constructor
public void update() {
frame.panel.update();
} //update
public void badUpdate() {
frame.panel.badUpdate();
} //badUpdate
///////////////////// INNER CLASS ////////////////////////
private class WFrame extends JFrame {
private MainPanel panel;
private WFrame() {
super("Wasteland");
JPanel p=new JPanel(new FlowLayout());
setPreferredSize(new Dimension(650,600));
panel=new MainPanel(500,600);
p.add(panel);
setContentPane(p);
setVisible(true);
setDefaultCloseOperation(EXIT_ON_CLOSE);
pack();
} //Frame
} //WFrame class
} //class