-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSecurePassManager.java
More file actions
44 lines (36 loc) · 1.21 KB
/
Copy pathSecurePassManager.java
File metadata and controls
44 lines (36 loc) · 1.21 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
import javax.swing.*;
import java.awt.*;
public class SecurePassManager {
private JFrame frame;
private CardLayout cardLayout;
private JPanel mainPanel;
private String currentUser = null;
public SecurePassManager() {
FileHandler.initializeDirectories();
setupGUI();
}
private void setupGUI() {
frame = new JFrame("SecurePass Manager");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(900, 600);
frame.setLocationRelativeTo(null);
cardLayout = new CardLayout();
mainPanel = new JPanel(cardLayout);
mainPanel.add(new LoginScreen(this).getPanel(), "Login");
mainPanel.add(new SignupScreen(this).getPanel(), "Signup");
frame.add(mainPanel);
frame.setVisible(true);
}
public void showScreen(String name) {
cardLayout.show(mainPanel, name);
}
public void setCurrentUser(String username) {
this.currentUser = username;
}
public String getCurrentUser() {
return currentUser; }
public JPanel getMainPanel() { return mainPanel; }
public static void main(String[] args) {
SwingUtilities.invokeLater(SecurePassManager::new);
}
}