-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUser.java
More file actions
120 lines (118 loc) · 2.93 KB
/
Copy pathUser.java
File metadata and controls
120 lines (118 loc) · 2.93 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
import javax.swing.*;
import java.awt.Color;
import java.awt.Font;
import javax.swing.JOptionPane;
import java.awt.Cursor;
import java.awt.event.*;
import java.awt.event.WindowListener;
import java.awt.event.WindowEvent;
public class User extends JFrame implements ActionListener
{
JPanel p1;
JMenuBar P;
JMenu My_Info,View,SC,L;
JMenuItem M1,M2,M3,M4,M5,M6,M7;
User()
{
setTitle("User");
p1 = new JPanel();
p1.setBackground(new Color(167,199,231));
p1.setBounds(0,0,2000,2000);
P = new JMenuBar();
My_Info = new JMenu("My Info");
My_Info.setFont(new Font("arial",Font.PLAIN,14));
View = new JMenu("View");
View.setFont(new Font("arial",Font.PLAIN,14));
SC = new JMenu("Schedule");
SC.setFont(new Font("arial", Font.PLAIN,14));
L= new JMenu("Logout");
M1 = new JMenuItem(" My Profile");
M2 = new JMenuItem("Credentials");
M3 = new JMenuItem("Attendence");
M4 = new JMenuItem("Trainer Details");
M5 = new JMenuItem("Payment Details");
M6 = new JMenuItem("Daily Schedule");
M7 = new JMenuItem("Logout");
M1.addActionListener(this);
M2.addActionListener(this);
M3.addActionListener(this);
M4.addActionListener(this);
M5.addActionListener(this);
M6.addActionListener(this);
M7.addActionListener(this);
add(p1);
P.add(My_Info);
P.add(View);
P.add(SC);
P.add(L);
My_Info.add(M1); My_Info.add(M2);
View.add(M3); View.add(M4); View.add(M5);
SC.add(M6);
L.add(M7);
setJMenuBar(P);
setLayout(null);
setSize(2000,2000);
setVisible(true);
setLocationRelativeTo(null);
addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
dispose();
}
});
}
public void actionPerformed(ActionEvent evt)
{
if(evt.getSource()==M1)
{
UMyProfile UM = new UMyProfile();
UM.setVisible(true);
UM.setLocationRelativeTo(null);
}
else if(evt.getSource()==M2)
{
UCredentials UC = new UCredentials();
UC.setVisible(true);
UC.setLocationRelativeTo(null);
}
else if(evt.getSource()==M3)
{
UAttendence UA = new UAttendence();
UA.setVisible(true);
UA.setLocationRelativeTo(null);
}
else if(evt.getSource()==M4)
{
UTrainerDetails UTD = new UTrainerDetails();
UTD.setVisible(true);
UTD.setLocationRelativeTo(null);
}
else if(evt.getSource()==M5)
{
UPaymentDetails UPD = new UPaymentDetails();
UPD.setVisible(true);
UPD.setLocationRelativeTo(null);
}
else if(evt.getSource()==M6)
{
UDailySchedule UD = new UDailySchedule();
UD.setVisible(true);
UD.setLocationRelativeTo(null);
}
else if(evt.getSource()==M7)
{
int a;
a=JOptionPane.showConfirmDialog(null,"Do you really want to quit user registration page?","Select",JOptionPane.YES_NO_OPTION);
if(a==0)
{
setVisible(false);
new Login().setVisible(true);
}
}
}
public static void main(String args[])
{
new User();
}
}