-
Notifications
You must be signed in to change notification settings - Fork 1
/
CustomerPage.java
66 lines (54 loc) · 1.88 KB
/
CustomerPage.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
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class CustomerPage extends JFrame implements ActionListener {
JButton getProfile , changePassword, updateEmail , updatePhone, back;
private String ID;
public CustomerPage(String ID) {
super("Customer Portal");
this.ID = ID;
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setSize(600, 600);
this.setForeground(Color.BLACK);
this.setVisible(true);
this.setLayout(new GridLayout(5, 1));
getProfile = new JButton("Show Profile");
changePassword = new JButton("Change Password");
updateEmail = new JButton("Update Email");
updatePhone = new JButton("Update Phone");
back = new JButton("Back");
this.add(getProfile);
this.add(changePassword);
this.add(updateEmail);
this.add(updatePhone);
this.add(back);
getProfile.addActionListener(this);
changePassword.addActionListener(this);
updateEmail.addActionListener(this);
updatePhone.addActionListener(this);
back.addActionListener(this);
}
@Override
public void actionPerformed(ActionEvent e) {
if (e.getSource() == getProfile) {
this.dispose();
new ShowProfile(ID);
}
else if (e.getSource() == changePassword) {
this.dispose();
new ChangePassword(ID);
}
else if (e.getSource() == updateEmail) {
this.dispose();
new ChangeEmail(ID);
}
else if (e.getSource() == updatePhone) {
this.dispose();
new ChangePhone(ID);
}
else if(e.getSource() == back) {
this.dispose();
new Main();
}
}
}