-
Notifications
You must be signed in to change notification settings - Fork 0
/
ManageEmployee.java
84 lines (77 loc) · 2.06 KB
/
ManageEmployee.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
74
75
76
77
78
79
80
81
82
83
84
import java.lang.*;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
public class ManageEmployee extends JFrame implements ActionListener
{
String UserId;
JButton back,logout,add,view;
JLabel imgLabel;
JPanel panel;
ImageIcon img;
public ManageEmployee(String UserId)
{
super(" Manage Employee ");
this.UserId=UserId;
this.setSize(800, 500);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Color myColor3=new Color(50,210,210);
panel =new JPanel();
panel.setLayout(null);
panel.setBackground(Color.white);
img = new ImageIcon("manager.png");
imgLabel = new JLabel(img);
imgLabel.setBounds(50,20,300,300);
panel.add(imgLabel);
logout=new JButton(" Log out ");
logout.setBounds(50,380,280,50);
logout.setBackground(Color.red);
logout.addActionListener(this);
panel.add(logout);
add = new JButton("Add Employee");
add.setBounds(450,100,280,50);
add.setBackground(myColor3);
add.addActionListener(this);
panel.add(add);
view=new JButton("View Employee");
view.setBounds(450,200,280,50);
view.setBackground(Color.blue);
view.addActionListener(this);
panel.add(view);
back=new JButton("Back");
back.setBounds(400,380,280,50);
back.setBackground(Color.green);
back.addActionListener(this);
panel.add(back);
this.add(panel);
}
public void actionPerformed(ActionEvent ae)
{
String text=ae.getActionCommand();
if(text.equals(logout.getText()))
{
LogIn ln=new LogIn();
ln.setVisible(true);
this.setVisible(false);
}
else if(text.equals(back.getText()))
{
ManagerHome mh=new ManagerHome(UserId);
mh.setVisible(true);
this.setVisible(false);
}
else if(text.equals(add.getText()))
{
AddEmployee am=new AddEmployee(UserId);
am.setVisible(true);
this.setVisible(false);
}
else if(text.equals(view.getText()))
{
ViewEmployee ve=new ViewEmployee(UserId);
ve.setVisible(true);
this.setVisible(false);
}
}
}