-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathECView.java
More file actions
83 lines (61 loc) · 2.04 KB
/
Copy pathECView.java
File metadata and controls
83 lines (61 loc) · 2.04 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
package cmsc141.mp1.ec;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.FlowLayout;
import java.awt.Font;
import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
public class ECView {
private ECFrame frame;
private JPanel buttonsPanel, textPanel, resultsPanel;
private JButton runButton, newButton;
private JTextArea textArea, resArea;
public ECView() {
frame = new ECFrame();
initComponents();
}
private void initComponents() {
buttonsPanel = new JPanel();
buttonsPanel.setLayout(new FlowLayout());
textPanel = new JPanel();
textPanel.setBackground(Color.LIGHT_GRAY);
textPanel.setLayout(new FlowLayout());
resultsPanel = new JPanel();
resultsPanel.setBackground(Color.GRAY);
resultsPanel.setLayout(new FlowLayout());
textArea = new JTextArea(Constants.HEIGHT/28, Constants.WIDTH/18);
textArea.setTabSize(2);
resArea = new JTextArea(Constants.HEIGHT/40, Constants.WIDTH/18);
resArea.setText("");
resArea.setEditable(false);
runButton = new JButton("Run");
newButton = new JButton("New");
buttonsPanel.add(runButton);
buttonsPanel.add(newButton);
textPanel.add(new JScrollPane(textArea));
resultsPanel.add(new JScrollPane(resArea));
frame.add(buttonsPanel, BorderLayout.NORTH);
frame.add(textPanel, BorderLayout.CENTER);
frame.add(resultsPanel, BorderLayout.SOUTH);
}
public void setJTextArea(String str) {
textArea.append(str);
}
public JButton getNewButton() {
return newButton;
}
public JButton getRunButton() {
return runButton;
}
public JTextArea getTextArea() {
return textArea;
}
public JTextArea getResArea() {
return resArea;
}
public ECFrame getFrame() {
return frame;
}
}