From 2ecb7d5a23851f1e09a59a5ea4fb6efb6657016c Mon Sep 17 00:00:00 2001 From: fdai7431 Date: Mon, 16 Jan 2023 12:22:31 +0100 Subject: [PATCH] [GamelauncherMain Class]: Actionlistener fuer Button --- .../JavaGamelauncher/GamelauncherMain.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/GamelauncherMain.java b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/GamelauncherMain.java index 92258d3..a06ae9c 100644 --- a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/GamelauncherMain.java +++ b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/GamelauncherMain.java @@ -3,6 +3,8 @@ package de.hs_fulda.gruppenprojekt.JavaGamelauncher; import java.awt.Color; import java.awt.EventQueue; import java.awt.Font; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JFrame; @@ -89,6 +91,18 @@ public class GamelauncherMain extends JFrame {//class contentPane.add(btnTikTakToe); contentPane.add(btnTextadventure); + btnSnake.addActionListener(new ActionListener() { + + @Override + public void actionPerformed(ActionEvent e) { + // TODO Auto-generated method stub + + //SnakeGame frameSnake = new SnakeGame(); + //frameSnake.setVisible(true); + } + }); + + }//end standardkonstruktor }//end class