-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathView3.java
More file actions
46 lines (41 loc) · 1.28 KB
/
Copy pathView3.java
File metadata and controls
46 lines (41 loc) · 1.28 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
import javax.swing.*;
import java.awt.*;
public class View3 extends JFrame{
JButton readB = new JButton("Read");
JButton runB = new JButton("Run");
JButton saveB = new JButton("Save");
JButton resetB = new JButton("Reset");
JPanel topPanel = new JPanel(new GridLayout(1,4));
JPanel centerPanel = new JPanel();
JPanel mainPanel = new JPanel(new BorderLayout());
JTextArea textArea = new JTextArea(20,40);
JScrollPane scroll = new JScrollPane(textArea);
/**
* The constructor for the View3 class that adds the GUI Components to the
* declared panels, adds the panels to the JFrame, and specifies JFrame
* attributes such as background color, bounds, and visibility.
*/
public View3() {
topPanel.setBackground(new Color(224, 226, 255));
mainPanel.setBackground(new Color(224, 226, 255));
centerPanel.setBackground(new Color(224, 226, 255));
topPanel.add(readB);
topPanel.add(runB);
topPanel.add(saveB);
topPanel.add(resetB);
centerPanel.add(scroll);
mainPanel.add(topPanel, BorderLayout.NORTH);
mainPanel.add(centerPanel, BorderLayout.CENTER);
setTitle("Basic interpreter");
add(mainPanel);
setBounds(50,50,520,420);
setVisible(true);
//validate();
}
/**
* This is the main method.
*/
public static void main(String args[]) {
new View3();
}
}