-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCAApp.java
More file actions
51 lines (37 loc) · 1023 Bytes
/
Copy pathCAApp.java
File metadata and controls
51 lines (37 loc) · 1023 Bytes
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
package edu.neu.csye6200.ca;
import javax.swing.JFrame;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.event.ActionListener;
import java.awt.event.WindowListener;
/**
* A sample abstract application class
* @author MMUNSON
*
*/
public abstract class CAApp implements ActionListener, WindowListener {
protected JFrame frame = null;
/*
* Default constructor
*/
public CAApp() {
initGUI();
}
/*
* Initializes GUI by creating a new frame
*/
public void initGUI() {
frame = new JFrame();
frame.setTitle("Crystal Automata");
frame.setResizable(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //JFrame.DISPOSE_ON_CLOSE)
// Permit the app to hear about the window opening
frame.addWindowListener(this);
frame.setLayout(new BorderLayout());
frame.add(getMainPanel(), BorderLayout.CENTER);
}
/*
* abstract method
*/
public abstract JPanel getMainPanel() ;
}