-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathAdminHome.java
111 lines (99 loc) · 3.76 KB
/
AdminHome.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
package net.javaguides.swing;
import javax.swing.*;
import javax.swing.border.EmptyBorder;
import java.awt.*;
import java.awt.event.*;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
public class AdminHome extends JFrame {
private static final long serialVersionUID = 1L;
private JPanel contentPane;
private JButton btnLogout;
private JButton btnChangePassword;
private JButton btnUpdateBooks;
private JButton btnAddUser;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
AdminHome frame = new AdminHome();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the frame.
*/
public AdminHome(String userSes) {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(450, 190, 1014, 597);
setResizable(false);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
JLabel lblAdminSection = new JLabel("Admin Section");
lblAdminSection.setForeground(Color.BLACK);
lblAdminSection.setFont(new Font("Times New Roman", Font.PLAIN, 46));
lblAdminSection.setBounds(378, 52, 333, 93);
contentPane.add(lblAdminSection);
btnLogout = new JButton("Logout");
btnLogout.setFont(new Font("Tahoma", Font.PLAIN, 26));
btnLogout.setBounds(396, 422, 218, 73);
btnLogout.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
dispose();
UserLogin ah = new UserLogin();
ah.setTitle("Welcome");
ah.setVisible(true);
JOptionPane.showMessageDialog(btnLogout, "You have successfully logged out");
}
});
contentPane.add(btnLogout);
btnChangePassword = new JButton("Password");
btnChangePassword.setFont(new Font("Tahoma", Font.PLAIN, 26));
btnChangePassword.setBounds(396, 161, 218, 73);
btnChangePassword.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
ChangePassword bo = new ChangePassword(userSes);
bo.setTitle("Change Password");
bo.setVisible(true);
}
});
contentPane.add(btnChangePassword);
btnUpdateBooks = new JButton("Update Books");
btnUpdateBooks.setFont(new Font("Tahoma", Font.PLAIN, 26));
btnUpdateBooks.setBounds(396, 292, 218, 73);
btnUpdateBooks.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
UpdateBooks updateBooks = new UpdateBooks(userSes);
updateBooks.setTitle("Update Books");
updateBooks.setVisible(true);
}
});
contentPane.add(btnUpdateBooks);
btnAddUser = new JButton("Add User");
btnAddUser.setFont(new Font("Tahoma", Font.PLAIN, 26));
btnAddUser.setBounds(396, 223, 218, 73);
btnAddUser.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
adduser userAdd = new adduser(userSes);
userAdd.setTitle("Add User");
userAdd.setVisible(true);
}
});
contentPane.add(btnAddUser);
}
public AdminHome() {
// TODO Auto-generated constructor stub
}
}