-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtaskgenform.java
More file actions
139 lines (97 loc) · 3.22 KB
/
taskgenform.java
File metadata and controls
139 lines (97 loc) · 3.22 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
/** author @ Shreyash Arya (2015097)h
Tushita Rathore (2015108)
*/
import javax.swing.border.EmptyBorder;
import java.awt.event.ActionListener ;
import java.awt.event.ActionEvent ;
import java.awt.* ;
import javax.swing.* ;
import java.util.*;
public class taskgenform {
JFrame taskfr = new JFrame();
JLabel head = new JLabel("Task Assignment Form");
JLabel id = new JLabel("ID:");
JLabel idDescription = new JLabel("ID will be system generated");
JLabel name = new JLabel("Task Name:");
JTextField nameTF = new JTextField("",250);
JLabel description = new JLabel("Task Description:");
JTextArea descpTA = new JTextArea(250,100);
String departmentA[] = {"--select department--", "Electricity", "Security","HVAC","Audio/Video","Housekeeping"};
JLabel departmentL = new JLabel("Department:");
JComboBox departmentF = new JComboBox(departmentA);
JLabel staffNo = new JLabel("Staff:");
JTextField staffNoTF = new JTextField("min. 1 staff is required",250);
JLabel equipment = new JLabel("Equipment:");
JTextArea equipTA = new JTextArea(250,100);
JLabel status = new JLabel("Status:");
JTextField statusTF = new JTextField("",250);
JLabel deadline = new JLabel("Deadline:");
JTextField deadlineTF = new JTextField("DD/MM/YY",250);
JButton submitB = new JButton("Submit");
JButton cancelB = new JButton("Cancel");
public taskgenform()
{
taskfr.setVisible(true);
taskfr.setResizable(false);
taskfr.setSize(700, 800);
taskfr.setLayout(null);
taskfr.add(head);
head.setBounds(100, 20, 400, 50);
head.setFont(new Font("Arial", Font.BOLD, 28));
taskfr.add(id);
id.setBounds(100, 50, 100, 100);
taskfr.add(idDescription);
idDescription.setBounds(300, 50, 250, 100);
idDescription.setForeground(Color.RED);
taskfr.add(name);
name.setBounds(100,80,100,100);
taskfr.add(nameTF);
nameTF.setBounds(300, 120, 250, 20);
taskfr.add(description);
description.setBounds(100,150,150,100);
taskfr.add(descpTA);
descpTA.setBounds(300,150,250,100);
taskfr.add(departmentL);
departmentL.setBounds(100,240,150,100);
taskfr.add(departmentF);
departmentF.setBounds(300,270,250,30);
taskfr.add(staffNo);
staffNo.setBounds(100, 280, 150, 100);
taskfr.add(staffNoTF);
staffNoTF.setBounds(300, 320, 250, 20);
taskfr.add(equipment);
equipment.setBounds(100, 350, 150, 100);
taskfr.add(equipTA);
equipTA.setBounds(300, 350, 250, 100);
taskfr.add(status);
status.setBounds(100, 435, 150, 100);
taskfr.add(statusTF);
statusTF.setBounds(300, 475, 250, 20);
taskfr.add(deadline);
deadline.setBounds(100,475,150,100);
taskfr.add(deadlineTF);
deadlineTF.setBounds(300, 510, 250, 20);
taskfr.add(submitB);
submitB.setBounds(300, 620, 250, 20);
taskfr.add(cancelB);
cancelB.setBounds(300, 650, 250, 20);
cancelEvent can = new cancelEvent();
cancelB.addActionListener(can);
submitEvent sub = new submitEvent();
submitB.addActionListener(sub);
}
public class cancelEvent implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
taskfr.dispose();
}
}
public class submitEvent implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
taskfr.dispose();
}
}
}