-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProject.java
More file actions
378 lines (290 loc) · 15.5 KB
/
Copy pathProject.java
File metadata and controls
378 lines (290 loc) · 15.5 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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package university.management.systems;
/**
*
* @author R.SHANMUKH
*/
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Project extends JFrame implements ActionListener{
Project(){
super("University Management System");
setSize(1920,1030);
ImageIcon ic = new ImageIcon(ClassLoader.getSystemResource("university/management/systems/icons/first.jpg"));
Image i3 = ic.getImage().getScaledInstance(1900, 950,Image.SCALE_DEFAULT);
ImageIcon icc3 = new ImageIcon(i3);
JLabel l1 = new JLabel(icc3);
add(l1);
JMenuBar mb = new JMenuBar();
JMenu master = new JMenu("Master");
JMenuItem m1 = new JMenuItem("New Faculty");
JMenuItem m2 = new JMenuItem("New Student Admission");
master.setForeground(Color.BLUE);
m1.setFont(new Font("monospaced",Font.BOLD,16));
ImageIcon icon1 = new ImageIcon(ClassLoader.getSystemResource("university/management/systems/icons/icon1.png"));
Image image1 = icon1.getImage().getScaledInstance(25, 25,Image.SCALE_DEFAULT);
m1.setIcon(new ImageIcon(image1));
m1.setMnemonic('A');
m1.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_D, ActionEvent.CTRL_MASK));
m1.setBackground(Color.WHITE);
m2.setFont(new Font("monospaced",Font.BOLD,16));
ImageIcon icon2 = new ImageIcon(ClassLoader.getSystemResource("university/management/systems/icons/icon2.png"));
Image image2 = icon2.getImage().getScaledInstance(20, 20,Image.SCALE_DEFAULT);
m2.setIcon(new ImageIcon(image2));
m2.setMnemonic('B');
m2.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_M, ActionEvent.CTRL_MASK));
m2.setBackground(Color.WHITE);
m1.addActionListener(this);
m2.addActionListener(this);
JMenu user = new JMenu("Details");
JMenuItem u1 = new JMenuItem("Student Details");
JMenuItem u2 = new JMenuItem("Teacher Details");
user.setForeground(Color.RED);
u1.setFont(new Font("monospaced",Font.BOLD,16));
ImageIcon icon4 = new ImageIcon(ClassLoader.getSystemResource("university/management/systems/icons/icon3.png"));
Image image4 = icon4.getImage().getScaledInstance(25, 25,Image.SCALE_DEFAULT);
u1.setIcon(new ImageIcon(image4));
u1.setMnemonic('C');
u1.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_P, ActionEvent.CTRL_MASK));
u1.setBackground(Color.WHITE);
u2.setFont(new Font("monospaced",Font.BOLD,16));
ImageIcon icon5 = new ImageIcon(ClassLoader.getSystemResource("university/management/systems/icons/icon4.jpg"));
Image image5 = icon5.getImage().getScaledInstance(25, 25,Image.SCALE_DEFAULT);
u2.setIcon(new ImageIcon(image5));
u2.setMnemonic('D');
u2.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_B, ActionEvent.CTRL_MASK));
u2.setBackground(Color.WHITE);
u1.addActionListener(this);
u2.addActionListener(this);
JMenu attendance = new JMenu("Attendance");
JMenuItem a1 = new JMenuItem("Student Attendance");
JMenuItem a2 = new JMenuItem("Teacher Attendance");
attendance.setForeground(Color.BLUE);
a1.setFont(new Font("monospaced",Font.BOLD,16));
ImageIcon icon23 = new ImageIcon(ClassLoader.getSystemResource("university/management/systems/icons/icon14.jpg"));
Image image24 = icon23.getImage().getScaledInstance(25, 25,Image.SCALE_DEFAULT);
a1.setIcon(new ImageIcon(image24));
a1.setMnemonic('M');
a1.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_P, ActionEvent.CTRL_MASK));
a1.setBackground(Color.WHITE);
attendance.add(a1);
a2.setFont(new Font("monospaced",Font.BOLD,16));
ImageIcon icon25 = new ImageIcon(ClassLoader.getSystemResource("university/management/systems/icons/icon15.png"));
Image image26 = icon25.getImage().getScaledInstance(25, 25,Image.SCALE_DEFAULT);
a2.setIcon(new ImageIcon(image26));
a2.setMnemonic('N');
a2.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_B, ActionEvent.CTRL_MASK));
a2.setBackground(Color.WHITE);
attendance.add(a2);
a1.addActionListener(this);
a2.addActionListener(this);
JMenu attendance_detail = new JMenu("Attendance Detail");
JMenuItem b1 = new JMenuItem("Student Attendance Detail");
JMenuItem b2 = new JMenuItem("Teacher Attendance Detail");
attendance_detail.setForeground(Color.RED);
b1.setFont(new Font("monospaced",Font.BOLD,16));
ImageIcon icon27 = new ImageIcon(ClassLoader.getSystemResource("university/management/systems/icons/icon15.png"));
Image image28 = icon27.getImage().getScaledInstance(25, 25,Image.SCALE_DEFAULT);
b1.setIcon(new ImageIcon(image28));
b1.setMnemonic('O');
b1.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_P, ActionEvent.CTRL_MASK));
b1.setBackground(Color.WHITE);
attendance_detail.add(b1);
b2.setFont(new Font("monospaced",Font.BOLD,16));
ImageIcon icon29 = new ImageIcon(ClassLoader.getSystemResource("university/management/systems/icons/icon14.jpg"));
Image image30 = icon29.getImage().getScaledInstance(25, 25,Image.SCALE_DEFAULT);
b2.setIcon(new ImageIcon(image30));
b2.setMnemonic('P');
b2.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_B, ActionEvent.CTRL_MASK));
b2.setBackground(Color.WHITE);
attendance_detail.add(b2);
b1.addActionListener(this);
b2.addActionListener(this);
JMenu exam = new JMenu("Examination");
JMenuItem c1 = new JMenuItem("Examination Details");
JMenuItem c2 = new JMenuItem("Enter Marks");
exam.setForeground(Color.BLUE);
c1.setFont(new Font("monospaced",Font.BOLD,16));
ImageIcon icon30 = new ImageIcon(ClassLoader.getSystemResource("university/management/systems/icons/icon16.png"));
Image image31 = icon30.getImage().getScaledInstance(25, 25,Image.SCALE_DEFAULT);
c1.setIcon(new ImageIcon(image31));
c1.setMnemonic('Q');
c1.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_P, ActionEvent.CTRL_MASK));
c1.setBackground(Color.WHITE);
exam.add(c1);
c2.setFont(new Font("monospaced",Font.BOLD,16));
ImageIcon icon32 = new ImageIcon(ClassLoader.getSystemResource("university/management/systems/icons/icon17.png"));
Image image33 = icon32.getImage().getScaledInstance(25, 25,Image.SCALE_DEFAULT);
c2.setIcon(new ImageIcon(image33));
c2.setMnemonic('R');
c2.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_B, ActionEvent.CTRL_MASK));
c2.setBackground(Color.WHITE);
exam.add(c2);
c1.addActionListener(this);
c2.addActionListener(this);
JMenu report = new JMenu("Update Details");
JMenuItem r1 = new JMenuItem("Update Students");
JMenuItem r2 = new JMenuItem("Update Teachers");
report.setForeground(Color.RED);
r1.setFont(new Font("monospaced",Font.BOLD,16));
ImageIcon icon7 = new ImageIcon(ClassLoader.getSystemResource("university/management/systems/icons/icon5.png"));
Image image7 = icon7.getImage().getScaledInstance(25, 25,Image.SCALE_DEFAULT);
r1.setIcon(new ImageIcon(image7));
r1.setMnemonic('E');
r1.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_R, ActionEvent.CTRL_MASK));
r1.setBackground(Color.WHITE);
r1.addActionListener(this);
r2.setFont(new Font("monospaced",Font.BOLD,16));
ImageIcon iconn = new ImageIcon(ClassLoader.getSystemResource("university/management/systems/icons/icon6.png"));
Image imagee = iconn.getImage().getScaledInstance(25, 25,Image.SCALE_DEFAULT);
r2.setIcon(new ImageIcon(imagee));
r2.setMnemonic('F');
r2.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_R, ActionEvent.CTRL_MASK));
r2.setBackground(Color.WHITE);
r2.addActionListener(this);
JMenu fee = new JMenu("Fee Details");
JMenuItem s1 = new JMenuItem("Fee Structure");
JMenuItem s2 = new JMenuItem("Student Fee Form");
fee.setForeground(Color.BLUE);
s1.setFont(new Font("monospaced",Font.BOLD,16));
ImageIcon icon14 = new ImageIcon(ClassLoader.getSystemResource("university/management/systems/icons/icon7.png"));
Image image15 = icon14.getImage().getScaledInstance(20, 20,Image.SCALE_DEFAULT);
s1.setIcon(new ImageIcon(image15));
s1.setMnemonic('G');
s1.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_R, ActionEvent.CTRL_MASK));
s1.setBackground(Color.WHITE);
s1.addActionListener(this);
s2.setFont(new Font("monospaced",Font.BOLD,16));
ImageIcon icon16 = new ImageIcon(ClassLoader.getSystemResource("university/management/systems/icons/icon8.png"));
Image image17 = icon16.getImage().getScaledInstance(20, 20,Image.SCALE_DEFAULT);
s2.setIcon(new ImageIcon(image17));
s2.setMnemonic('H');
s2.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_R, ActionEvent.CTRL_MASK));
s2.setBackground(Color.WHITE);
s2.addActionListener(this);
JMenu utility = new JMenu("Utility");
JMenuItem ut1 = new JMenuItem("Notepad");
JMenuItem ut2 = new JMenuItem("Calculator");
JMenuItem ut3 = new JMenuItem("Web Browser");
utility.setForeground(Color.RED);
ut1.setFont(new Font("monospaced",Font.BOLD,16));
ImageIcon icon18 = new ImageIcon(ClassLoader.getSystemResource("university/management/systems/icons/icon9.png"));
Image image19 = icon18.getImage().getScaledInstance(25, 25,Image.SCALE_DEFAULT);
ut1.setIcon(new ImageIcon(image19));
ut1.setMnemonic('I');
ut1.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, ActionEvent.CTRL_MASK));
ut1.setBackground(Color.WHITE);
ut2.setFont(new Font("monospaced",Font.BOLD,16));
ImageIcon icon20 = new ImageIcon(ClassLoader.getSystemResource("university/management/systems/icons/icon10.png"));
Image image21 = icon20.getImage().getScaledInstance(25, 25,Image.SCALE_DEFAULT);
ut2.setIcon(new ImageIcon(image21));
ut2.setMnemonic('J');
ut2.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, ActionEvent.CTRL_MASK));
ut2.setBackground(Color.WHITE);
ut3.setFont(new Font("monospaced",Font.BOLD,16));
ImageIcon icon10 = new ImageIcon(ClassLoader.getSystemResource("university/management/systems/icons/icon11.png"));
Image image10 = icon10.getImage().getScaledInstance(25, 25,Image.SCALE_DEFAULT);
ut3.setIcon(new ImageIcon(image10));
ut3.setMnemonic('K');
ut3.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_W, ActionEvent.CTRL_MASK));
ut3.setBackground(Color.WHITE);
ut1.addActionListener(this);
ut2.addActionListener(this);
ut3.addActionListener(this);
JMenu exit = new JMenu("Exit");
JMenuItem ex = new JMenuItem("Exit");
exit.setForeground(Color.RED);
ex.setFont(new Font("monospaced",Font.BOLD,16));
ImageIcon icon11 = new ImageIcon(ClassLoader.getSystemResource("university/management/systems/icons/icon12.png"));
Image image11 = icon11.getImage().getScaledInstance(25, 25,Image.SCALE_DEFAULT);
ex.setIcon(new ImageIcon(image11));
ex.setMnemonic('Z');
ex.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Z, ActionEvent.CTRL_MASK));
ex.setBackground(Color.WHITE);
ex.addActionListener(this);
master.add(m1);
master.add(m2);
user.add(u1);
user.add(u2);
report.add(r1);
report.add(r2);
fee.add(s1);
fee.add(s2);
utility.add(ut1);
utility.add(ut2);
utility.add(ut3);
exit.add(ex);
mb.add(master);
mb.add(user);
mb.add(attendance);
mb.add(attendance_detail);
mb.add(exam);
mb.add(report);
mb.add(fee);
mb.add(utility);
mb.add(exit);
setJMenuBar(mb);
setFont(new Font("Senserif",Font.BOLD,16));
setLayout(new FlowLayout());
setVisible(false);
}
public void actionPerformed(ActionEvent ae){
String msg = ae.getActionCommand();
if(msg.equals("New Student Admission")){
new AddStudent().f.setVisible(true);
}else if(msg.equals("New Faculty")){
new AddTeacher().f.setVisible(true);
}else if(msg.equals("Student Details")){
new StudentDetails().setVisible(true);
}else if(msg.equals("Teacher Details")){
new TeacherDetails().setVisible(true);
}
else if(msg.equals("Update Students")){
new UpdateStudent().f.setVisible(true);
}
else if(msg.equals("Update Teachers")){
new UpdateTeacher().f.setVisible(true);
}
else if(msg.equals("Fee Structure")){
new FeeStructure().setVisible(true);
}
else if(msg.equals("Student Fee Form")){
new StudentFeeForm().setVisible(true);
}
else if(msg.equals("Notepad")){
try{
Runtime.getRuntime().exec("notepad.exe");
}catch(Exception e){ }
}else if(msg.equals("Calculator")){
try{
Runtime.getRuntime().exec("calc.exe");
}catch(Exception e){ }
}else if(msg.equals("Web Browser")){
try{
Runtime.getRuntime().exec("C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe");
}catch(Exception e){ }
}else if(msg.equals("Exit")){
System.exit(0);
}else if(msg.equals("Student Attendance")){
new StudentAttendance().setVisible(true);
}else if(msg.equals("Teacher Attendance")){
new TeacherAttendance().setVisible(true);
}else if(msg.equals("Student Attendance Detail")){
new StudentAttendanceDetail().setVisible(true);
}else if(msg.equals("Teacher Attendance Detail")){
new TeacherAttendanceDetail().setVisible(true);
}else if(msg.equals("Examination Details")){
new ExaminationDetails().setVisible(true);
}else if(msg.equals("Enter Marks")){
new EnterMarks().setVisible(true);
}
}
public static void main(String[] args){
new Project().setVisible(true);
}
}