Browse Source

added restart and closing button after winning

master
Ozan-Can Ekinci 2 years ago
parent
commit
49de036b77
  1. 10
      src/main/java/Gui/GameGui.java

10
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

Loading…
Cancel
Save