|
|
@ -1,10 +1,13 @@ |
|
|
|
package solitaer; |
|
|
|
|
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
import java.awt.event.ActionListener; |
|
|
|
|
|
|
|
import javax.swing.JMenu; |
|
|
|
import javax.swing.JMenuBar; |
|
|
|
import javax.swing.JMenuItem; |
|
|
|
|
|
|
|
public class SolitaerMenue { |
|
|
|
public class SolitaerMenue implements ActionListener{ |
|
|
|
|
|
|
|
JMenuBar menuBar = new JMenuBar(); |
|
|
|
|
|
|
@ -15,10 +18,13 @@ public class SolitaerMenue { |
|
|
|
|
|
|
|
public SolitaerMenue() { |
|
|
|
|
|
|
|
this.restart.addActionListener(this); |
|
|
|
this.menu.add(restart); |
|
|
|
this.menu.addSeparator(); |
|
|
|
this.quit.addActionListener(this); |
|
|
|
this.menu.add(quit); |
|
|
|
|
|
|
|
|
|
|
|
this.menuBar.add(menu); |
|
|
|
|
|
|
|
} |
|
|
@ -27,4 +33,14 @@ public class SolitaerMenue { |
|
|
|
return menuBar; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
// TODO Auto-generated method stub |
|
|
|
if(e.getSource() == this.quit) { |
|
|
|
System.out.println("quit"); |
|
|
|
System.exit(0); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |