Guest User

Untitled

a guest
Dec 13th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. public class Menu extends JPanel implements ActionListener {
  2.  
  3. protected JFrame frame;
  4. JButton btnStart = new JButton();
  5.  
  6. public Menu(JFrame j) {
  7.  
  8. super();
  9. frame = j;
  10.  
  11. //creating and styling button
  12.  
  13. btnStart.addActionListener(new java.awt.event.ActionListener() {
  14. public void actionPerformed(java.awt.event.ActionEvent evt) {
  15. StartGame();
  16. }
  17. });
  18.  
  19.  
  20.  
  21. }
  22.  
  23. private void StartGame(){
  24. frame.getContentPane().removeAll();
  25. frame.getContentPane().add(new Main(frame));
  26. frame.repaint();
  27.  
  28. }
Add Comment
Please, Sign In to add comment