-
Notifications
You must be signed in to change notification settings - Fork 0
/
Elac.java
74 lines (51 loc) · 1.34 KB
/
Elac.java
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
import java.awt.*;
import javax.swing.*;
class Elac extends Jframe {
public Elac() {
c = getContainer();
c.setLayout(new GridLayout());
JLabel myLab = new JLabel();
c = getContentPane();
JLabel myLab = new JLabel();
Font f = new Font("Times new Roman", font.bold + font.italic);
myLab.setFont(f);
myLab.setText("Elac");
JPanel p1 = new JPanel();
p1.setBackgroud(Color.YELLOW);
p1.add(myLab);
// END OF P1
JPanel p2 = new JPanel();
p2.setLayout(new GridLayout(3,2,5,5));
p2.add(new JLabel("First Name: "));
t1 = new JTextField(10);
p2.add(t1);
p2.add(new JLabel("Last Name: "));
t2 = new JTextField(10);
p2.add(t2);
p2.add(new JLabel("Enter ID: "));
t3 = new JTextField(10);
p2.add(t3);
p2.setBackground(Color.GREEN);
JPanel p3 = new JPanel();
p3.setLayout(new FlowLayout());
b1 = new JButton("Add");
b2 = new JButton("Clear");
b3 = new JButton("Show");
b4 = new JButton("Save");
b5 = new JButton("Remove");
p3.add(b1);
p3.add(b2);
p3.add(b3);
p3.add(b4);
p3.add(b5);
c.add(p1);
c.add(p2);
c.add(p3);
}
public static void main(String[] args) {
Elac win = new Elac();
win.setSize(400, 300);
win.setVisible(true);
win.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}