diff --git a/src/main/java/solitaer/SolitaerMenue.java b/src/main/java/solitaer/SolitaerMenue.java index e2c854b..76a86ef 100644 --- a/src/main/java/solitaer/SolitaerMenue.java +++ b/src/main/java/solitaer/SolitaerMenue.java @@ -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); + } + + } + }