Browse Source

add ActionListener to Start Button

master
Leon Montag 2 years ago
parent
commit
afd9aa2478
  1. 15
      src/main/java/Gui/StartGameGui.java
  2. 1
      src/main/java/Gui/gui.java

15
src/main/java/Gui/StartGameGui.java

@ -0,0 +1,15 @@
package Gui;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class StartGameGui implements ActionListener {
@Override
public void actionPerformed(ActionEvent e) {
gui.Panel.setVisible(false);
}
}

1
src/main/java/Gui/gui.java

@ -32,6 +32,7 @@ public class gui {
public void createButtons() { public void createButtons() {
StartBtn = new JButton("Starte Spiel"); StartBtn = new JButton("Starte Spiel");
StartBtn.addActionListener(new StartGameGui());
CloseBtn = new JButton("Schlieen"); CloseBtn = new JButton("Schlieen");
CloseBtn.addActionListener(new ActionHandler()); CloseBtn.addActionListener(new ActionHandler());

Loading…
Cancel
Save