-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathShowPassword.java
More file actions
49 lines (38 loc) · 1.31 KB
/
ShowPassword.java
File metadata and controls
49 lines (38 loc) · 1.31 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
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class ShowPassword extends JFrame implements ActionListener {
private JLabel ID;
private JTextField IDTextField;
private JButton search, back;
public ShowPassword() {
this.setSize(600, 600);
this.setForeground(Color.BLACK);
this.setVisible(true);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setLayout(new GridLayout(2, 2));
ID = new JLabel("Customer ID");
IDTextField = new JTextField();
search = new JButton("Search");
back = new JButton("Back");
this.add(ID);
this.add(IDTextField);
this.add(search);
this.add(back);
search.addActionListener(this);
back.addActionListener(this);
}
@Override
public void actionPerformed(ActionEvent e) {
if (e.getSource() == search) {
AdminOperations ao = new AdminOperations();
String ID = IDTextField.getText();
String details = ao.getPass(ID);
JOptionPane.showMessageDialog(null, details);
}
else if(e.getSource() == back) {
this.dispose();
new Admin();
}
}
}