-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTextCalcu.java
More file actions
42 lines (39 loc) · 1.01 KB
/
TextCalcu.java
File metadata and controls
42 lines (39 loc) · 1.01 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
import java.awt.*;
import javax.swing.*;
public class TextCalcu
{
private JFrame frame;
private JPanel p1,p2,p3;
JTextField text;
public static void main(String []args)
{
TextCalcu that = new TextCalcu();
that.go();
}
void go()
{
frame = new JFrame("Calcu");
Container contentPane = frame.getContentPane();
p1 = new JPanel();
p1.setLayout(new BoxLayout(p1,BoxLayout.Y_AXIS));
p1.add(new JLabel("number1"));
p1.add(new JLabel("number2"));
p1.add(new JLabel("number3"));
contentPane.add(p1, BorderLayout.WEST);
p2=new JPanel();
p2.setLayout(new BoxLayout(p2,BoxLayout.Y_AXIS));
p2.add(new JButton());
p2.add(new JButton());
p2.add(new JButton());
contentPane.add(p2,BorderLayout.CENTER);
p3 = new JPanel();
p3.setLayout(new BoxLayout(p3, BoxLayout.X_AXIS));
p3.add(new JButton("ADD"));
p3.add(new JButton("SUB"));
p3.add(new JButton("MUL"));
p3.add(new JButton("DIV"));
contentPane.add(p3,BorderLayout.SOUTH);
frame.pack();
frame.setVisible(true);
}
}