-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathEmployee.java
More file actions
62 lines (52 loc) · 1.63 KB
/
Employee.java
File metadata and controls
62 lines (52 loc) · 1.63 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
package Basic;
import java.awt.Button;
import java.awt.Container;
import java.awt.GridLayout;
import javax.swing.ButtonGroup;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
public class Employee extends JFrame {
JFrame f = new JFrame("Employee Details ");
JLabel lblUser = new JLabel("Name");
JTextField tfUser = new JTextField(10);
JLabel lblGender = new JLabel("Gender");
JRadioButton rdoMale = new JRadioButton("Male");
JRadioButton rdoFemale = new JRadioButton("Female");
ButtonGroup bgGender = new ButtonGroup();
String grade[]= { "Elementary","High School","Undergraduate","Master","Doctor"};
JLabel lblGrade = new JLabel("Grade");
JList lstGrade = new JList(grade);
JLabel lblDepartment = new JLabel("Department");
String department[]= {"VKU","Axon Active","Fpt","Enclave"};
JComboBox cboDepartment = new JComboBox(department);
JButton bnSave = new JButton("Add Employee");
public Employee() {
Container cont = f.getContentPane();
f.setLayout(new GridLayout(6,2));
f.setLocation(300, 100);
f.add(lblUser);
f.add(tfUser);
f.add(lblGender);
f.add(rdoMale);
f.add(rdoFemale);
bgGender.add(rdoFemale);
bgGender.add(rdoMale);
f.add(lblGender);
f.add(lstGrade);
f.add(lblDepartment);
f.add(cboDepartment);
f.add(bnSave);
f.setSize(300,700);
f.pack();
f.setVisible(true);
}
public static void main(String[] args) {
// TODO Auto-generated method stub
new Employee();
}
}