-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAdminFinancialManage.java
150 lines (119 loc) · 4.05 KB
/
AdminFinancialManage.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
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
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
import java.sql.*;
public class AdminFinancialManage extends JFrame implements MouseListener
{
private JLabel LabelTitle,LabelBackGroundImage,WelcomeLabel;
private JButton buttonReciveBill, buttonPaySalary, buttonSeeDetail, buttonBack;
private JPanel panel;
private int AdminId;
public AdminFinancialManage(int AdminId)
{
super("Admin Financial Manager");
Color lightButton = new Color(71, 92, 150);
Color lightBlue = new Color(172, 166, 255);
this.setSize(600, 650);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setLocationRelativeTo(null);
panel = new JPanel();
panel.setLayout(null);
panel.setBackground(Color.WHITE);
ImageIcon img = new ImageIcon("icon.jpg");
this.setIconImage(img.getImage());
LabelBackGroundImage = new JLabel();
LabelBackGroundImage.setBounds(0,0, 600,180);
ImageIcon imgThisImg = new ImageIcon("logInBackground.JPG");
LabelBackGroundImage.setIcon(imgThisImg);
panel.add(LabelBackGroundImage);
this.AdminId=AdminId;
LabelTitle = new JLabel("Financial Management");
LabelTitle.setFont(new Font("Tahoma", Font.PLAIN, 19));
LabelTitle.setForeground(Color.BLACK);
LabelTitle.setBounds(195,190,250,30);
panel.add(LabelTitle);
buttonReciveBill = new JButton("Recive Bill");
buttonReciveBill.setBounds(210,250,160,30);
buttonReciveBill.setFont(new Font("Ariel", Font.PLAIN, 16));
buttonReciveBill.setForeground(Color.BLACK);
buttonReciveBill.setBackground(lightButton);
buttonReciveBill.addMouseListener(this);
panel.add(buttonReciveBill);
buttonPaySalary = new JButton("Pay Salary");
buttonPaySalary.setBounds(210,290,160,30);
buttonPaySalary.setFont(new Font("Ariel", Font.PLAIN, 16));
buttonPaySalary.setForeground(Color.BLACK);
buttonPaySalary.setBackground(lightButton);
buttonPaySalary.addMouseListener(this);
panel.add(buttonPaySalary);
buttonSeeDetail = new JButton("Check Payment");
buttonSeeDetail.setBounds(210,330,160,30);
buttonSeeDetail.setFont(new Font("Ariel", Font.PLAIN, 16));
buttonSeeDetail.setForeground(Color.BLACK);
buttonSeeDetail.setBackground(lightButton);
buttonSeeDetail.addMouseListener(this);
panel.add(buttonSeeDetail);
buttonBack = new JButton("Back");
buttonBack.setBounds(210,370,160,30);
buttonBack.setFont(new Font("Ariel", Font.PLAIN, 16));
buttonBack.setForeground(Color.BLACK);
buttonBack.setBackground(lightButton);
buttonBack.addMouseListener(this);
panel.add(buttonBack);
WelcomeLabel = new JLabel(" Logged in as : Admin");
WelcomeLabel.setBounds(215, 520, 200, 20);
WelcomeLabel.setFont(new Font("Tahoma", Font.PLAIN, 15));
WelcomeLabel.setForeground(Color.BLACK);
panel.add(WelcomeLabel);
WelcomeLabel = new JLabel(" ID : "+AdminId);
WelcomeLabel.setBounds(255, 550, 200, 20);
WelcomeLabel.setFont(new Font("Tahoma", Font.PLAIN, 15));
WelcomeLabel.setForeground(Color.BLACK);
panel.add(WelcomeLabel);
this.add(panel);
}//end of constructor
public void mouseEntered(MouseEvent me){}
public void mouseExited(MouseEvent me){}
public void mouseReleased(MouseEvent me){}
public void mousePressed(MouseEvent me){}
public void mouseClicked(MouseEvent me)
{
JButton b = (JButton) me.getComponent();
if(b==buttonReciveBill)
{
System.out.println("buttonReciveBill");
ReceiveBill recBill = new ReceiveBill(AdminId);
try{
this.setVisible(false);
recBill.setVisible(true);
}catch(Exception ex){}
}
else if(b==buttonPaySalary)
{
System.out.println("buttonPaySalary");
PaySalary instructor = new PaySalary(AdminId);
try{
this.setVisible(false);
instructor.setVisible(true);
}catch(Exception ex){}
}
else if(b==buttonSeeDetail)
{
System.out.println("buttonSeeDetail");
SeeDetails see = new SeeDetails(AdminId);
try{
this.setVisible(false);
see.setVisible(true);
}catch(Exception ex){}
}
else if(b==buttonBack)
{
System.out.println("buttonBack");
AdminHome admin = new AdminHome(AdminId);
try{
this.setVisible(false);
admin.setVisible(true);
}catch(Exception ex){}
}
}
}