From 11203381de151554919e13b7d1493bfc079ab2e6 Mon Sep 17 00:00:00 2001 From: Ozan-Can Ekinci Date: Tue, 10 Jan 2023 17:36:42 +0100 Subject: [PATCH] created winningpanel method --- src/main/java/Gui/GameGui.java | 15 +++++++++++++-- src/main/java/Gui/GameGuiInterface.java | 2 ++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/main/java/Gui/GameGui.java b/src/main/java/Gui/GameGui.java index 11cdc60..fbc55c2 100644 --- a/src/main/java/Gui/GameGui.java +++ b/src/main/java/Gui/GameGui.java @@ -15,8 +15,8 @@ import game.loadNextQuestion; public class GameGui implements GameGuiInterface { -public static JPanel MainPanel, ButtonPanel, headingPanel; -public static JLabel Headline,QuestionLabel; +public static JPanel MainPanel, ButtonPanel, headingPanel, WinningPanel; +public static JLabel Headline,QuestionLabel,WinningLabel; public static JButton AnswersBtn1,AnswersBtn2,AnswersBtn3,AnswersBtn4; public static int questionNr = 0; GridLayout grid; @@ -41,6 +41,17 @@ GridBagConstraints gbc; headingPanel.setLayout(grid); gui.Frame.add(MainPanel); } + @Override + public void createWinningPanel() { + GameGui.MainPanel.setVisible(false); + GameGui.ButtonPanel.setVisible(false); + WinningPanel = new JPanel(); + WinningLabel = new JLabel("Du hast Gewonnen!"); + WinningPanel.add(WinningLabel); + gui.Frame.add(WinningPanel); + } + + @Override public void createHeadline() { Headline = new JLabel("Wer wird Millionär?"); diff --git a/src/main/java/Gui/GameGuiInterface.java b/src/main/java/Gui/GameGuiInterface.java index c1efd62..2802b66 100644 --- a/src/main/java/Gui/GameGuiInterface.java +++ b/src/main/java/Gui/GameGuiInterface.java @@ -5,6 +5,8 @@ public interface GameGuiInterface { void createGui(); void CreatePanel(); + + void createWinningPanel(); void createHeadline();