-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCalculatorFrame.java
More file actions
54 lines (41 loc) · 1.18 KB
/
CalculatorFrame.java
File metadata and controls
54 lines (41 loc) · 1.18 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
package calc;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import javax.swing.JFrame;
public class CalculatorFrame extends JFrame {
private CalculatorMenuBar menuBar;
private CalculatorTextFieldPanel inputPanel;
private CalculatorBitsDisplayPanel bitsPanel;
private CalculatorNumberBasePanel basePanel;
private CalculatorWordPanel wordPanel;
private CalculatorInputButtonsPanel buttonPanel;
public CalculatorFrame () {
menuBar = new CalculatorMenuBar();
setJMenuBar(menuBar);
setLayout(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
c.fill = GridBagConstraints.BOTH;
inputPanel = new CalculatorTextFieldPanel();
c.gridx = 0;
c.gridy = 0;
c.gridwidth = 3;
add(inputPanel, c);
bitsPanel = new CalculatorBitsDisplayPanel();
c.gridy = 1;
c.gridwidth = 3;
add(bitsPanel, c);
basePanel = new CalculatorNumberBasePanel();
c.gridy = 2;
c.gridwidth = 1;
add(basePanel, c);
wordPanel = new CalculatorWordPanel();
c.gridy = 3;
add(wordPanel, c);
buttonPanel = new CalculatorInputButtonsPanel();
c.gridx = 1;
c.gridy = 2;
c.gridwidth = 2;
c.gridheight = 2;
add(buttonPanel, c);
}
}