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); } }