From d71484174b30b7fd992f5f24aaeb1718add84a8d Mon Sep 17 00:00:00 2001 From: Yazan Alaamer Date: Fri, 20 Jan 2023 20:04:06 +0100 Subject: [PATCH] create game screen --- src/main/java/game/StartDarkSoulsGame.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/game/StartDarkSoulsGame.java b/src/main/java/game/StartDarkSoulsGame.java index 48221b5..568ad7f 100644 --- a/src/main/java/game/StartDarkSoulsGame.java +++ b/src/main/java/game/StartDarkSoulsGame.java @@ -22,6 +22,7 @@ public class StartDarkSoulsGame { Font normalFont = new Font ("Times new Roman", Font.PLAIN, 28); JButton startButton; Container con; + TitelScreenHandler tsHandler= new TitelScreenHandler(); public StartDarkSoulsGame() { gui.Frame.setSize(800, 600); @@ -43,6 +44,7 @@ public class StartDarkSoulsGame { startButton = new JButton("START"); startButton.setBackground(Color.black); startButton.setForeground(Color.white); + startButton.addActionListener(tsHandler); titleNamePanel.add(titelNameLabel); StartButtonPanel.add(startButton); @@ -65,4 +67,10 @@ public class StartDarkSoulsGame { mainTextArea.setLineWrap(true); mainTextPanel.add(mainTextArea); } + public class TitelScreenHandler implements ActionListener{ + public void actionPerformed(ActionEvent event) { + createGameScreen(); + } + + } }