Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Menu extends JPanel implements ActionListener {
- protected JFrame frame;
- JButton btnStart = new JButton();
- public Menu(JFrame j) {
- super();
- frame = j;
- //creating and styling button
- btnStart.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- StartGame();
- }
- });
- }
- private void StartGame(){
- frame.getContentPane().removeAll();
- frame.getContentPane().add(new Main(frame));
- frame.repaint();
- }
Add Comment
Please, Sign In to add comment