Newer
Older
Algolike / src / main / java / views / StartPanel.java
Shinji on 9 Aug 2022 529 bytes コードの整形
package views;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class StartPanel extends JPanel {
    public StartPanel(MainPanel mainPanel) {
        super(new BorderLayout());
        var button = new JButton("Start");
        button.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                mainPanel.setVisible(true);
            }
        });
        add(button);
    }
}