|
@ -9,6 +9,8 @@ import javax.swing.JMenuItem; |
|
|
|
|
|
|
|
|
public class SolitaerMenue implements ActionListener{ |
|
|
public class SolitaerMenue implements ActionListener{ |
|
|
|
|
|
|
|
|
|
|
|
SolitaerGamePanel solitaerpanel; |
|
|
|
|
|
|
|
|
JMenuBar menuBar = new JMenuBar(); |
|
|
JMenuBar menuBar = new JMenuBar(); |
|
|
|
|
|
|
|
|
JMenu menu = new JMenu("options"); |
|
|
JMenu menu = new JMenu("options"); |
|
@ -16,7 +18,9 @@ public class SolitaerMenue implements ActionListener{ |
|
|
JMenuItem restart = new JMenuItem("restart"); |
|
|
JMenuItem restart = new JMenuItem("restart"); |
|
|
JMenuItem quit = new JMenuItem("quit"); |
|
|
JMenuItem quit = new JMenuItem("quit"); |
|
|
|
|
|
|
|
|
public SolitaerMenue() { |
|
|
|
|
|
|
|
|
public SolitaerMenue(SolitaerGamePanel _panel) { |
|
|
|
|
|
|
|
|
|
|
|
solitaerpanel = _panel; |
|
|
|
|
|
|
|
|
this.restart.addActionListener(this); |
|
|
this.restart.addActionListener(this); |
|
|
this.menu.add(restart); |
|
|
this.menu.add(restart); |
|
@ -41,6 +45,10 @@ public class SolitaerMenue implements ActionListener{ |
|
|
System.exit(0); |
|
|
System.exit(0); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(e.getSource() == this.restart) { |
|
|
|
|
|
solitaerpanel.restartGame(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |