Added some migrations and Simple GUI
This commit is contained in:
36
src/main/java/ui/MyFrame.java
Normal file
36
src/main/java/ui/MyFrame.java
Normal file
@@ -0,0 +1,36 @@
|
||||
package ui;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
||||
public class MyFrame extends JFrame {
|
||||
JPanel mainPanel = new JPanel(new CardLayout());
|
||||
|
||||
public void changePanel(String panel) {
|
||||
|
||||
}
|
||||
|
||||
public MyFrame() {
|
||||
super("Todo App");
|
||||
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
setSize(800, 600);
|
||||
setLocation(50, 50);
|
||||
setLayout(new CardLayout());
|
||||
|
||||
JPanel startPanel = new JPanel();
|
||||
JButton loginButton = new JButton("Login");
|
||||
|
||||
startPanel.add(loginButton);
|
||||
mainPanel.add(startPanel, "start");
|
||||
mainPanel.add(LoginPanel.getLoginPanel(), "login");
|
||||
|
||||
loginButton.addActionListener(e -> {
|
||||
CardLayout cl = (CardLayout)mainPanel.getLayout();
|
||||
cl.show(mainPanel, "login");
|
||||
});
|
||||
|
||||
add(mainPanel);
|
||||
|
||||
setVisible(true);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user