From 49de036b7733aa6abdcae1fad1bef556b8697bc1 Mon Sep 17 00:00:00 2001 From: Ozan-Can Ekinci Date: Thu, 12 Jan 2023 18:15:43 +0100 Subject: [PATCH] added restart and closing button after winning --- src/main/java/Gui/GameGui.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/Gui/GameGui.java b/src/main/java/Gui/GameGui.java index 64ba1c4..9ce5fac 100644 --- a/src/main/java/Gui/GameGui.java +++ b/src/main/java/Gui/GameGui.java @@ -17,7 +17,7 @@ public class GameGui implements GameGuiInterface { public static JPanel MainPanel, ButtonPanel, headingPanel, WinningPanel, LosingPanel; public static JLabel Headline,QuestionLabel,WinningLabel, LosingLabel; -public static JButton AnswersBtn1,AnswersBtn2,AnswersBtn3,AnswersBtn4,RestartBtn,ClosingBtn; +public static JButton AnswersBtn1,AnswersBtn2,AnswersBtn3,AnswersBtn4,RestartBtn,RestartBtn1,ClosingBtn; public static int questionNr = 0; GridLayout grid; GridBagConstraints gbc; @@ -76,14 +76,20 @@ GridBagConstraints gbc; public void createWinningPanel() { GameGui.MainPanel.setVisible(false); GameGui.ButtonPanel.setVisible(false); + + RestartBtn1 = new JButton("Nochmal Spielen"); + ClosingBtn = new JButton("Schliessen"); + WinningPanel = new JPanel(new GridLayout()); WinningLabel = new JLabel("Du hast Gewonnen!"); WinningLabel.setVerticalAlignment(JLabel.CENTER); WinningLabel.setHorizontalAlignment(JLabel.CENTER); WinningLabel.setFont(new Font("Serif", Font.BOLD, 28)); + WinningPanel.add(WinningLabel); + WinningPanel.add(RestartBtn1); + WinningPanel.add(ClosingBtn); gui.Frame.add(WinningPanel); - WinningPanel.setVisible(true); } @Override