-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathAdmin.java
More file actions
91 lines (74 loc) · 2.68 KB
/
Admin.java
File metadata and controls
91 lines (74 loc) · 2.68 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
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class Admin extends JFrame implements ActionListener {
private JButton addCustomer,readAllCustomers, searchCustomer, updateCustomer, deleteCustomer,ShowPasswords, monthButton;
private JButton back;
public Admin() {
super("Admin Screen");
this.setSize(600, 600);
this.setForeground(Color.BLACK);
this.setVisible(true);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setLayout(new GridLayout(6, 1));
addCustomer = new JButton("Add Profile");
readAllCustomers = new JButton("View All Customers");
searchCustomer = new JButton("Search Info");
updateCustomer = new JButton("Update Info");
deleteCustomer = new JButton("Delete Profile");
ShowPasswords = new JButton("Get Passwords");
monthButton=new JButton("More than Month");
back = new JButton("Back");
this.add(addCustomer);
this.add(readAllCustomers);
this.add(searchCustomer);
this.add(updateCustomer);
this.add(deleteCustomer);
this.add(ShowPasswords);
this.add(monthButton);
this.add(back);
addCustomer.addActionListener(this);
readAllCustomers.addActionListener(this);
searchCustomer.addActionListener(this);
updateCustomer.addActionListener(this);
deleteCustomer.addActionListener(this);
ShowPasswords.addActionListener(this);
monthButton.addActionListener(this);
back.addActionListener(this);
}
@Override
public void actionPerformed(ActionEvent e) {
if (e.getSource() == addCustomer) {
this.dispose();
new AddCustomer();
}
else if (e.getSource() == readAllCustomers) {
this.dispose();
new Display();
}
else if(e.getSource() == searchCustomer) {
this.dispose();
new SearchCustomer();
}
else if(e.getSource() == updateCustomer) {
this.dispose();
new UpdateCustomer();
}
else if(e.getSource() == deleteCustomer) {
this.dispose();
new DeleteCustomer();
}
else if (e.getSource() == ShowPasswords) {
this.dispose();
new ShowPassword();
}
else if (e.getSource() == monthButton) {
this.dispose();
new Month();
}
else if(e.getSource() == back) {
this.dispose();
new Main();
}
}
}