Browse Source

added restart button

master
Ozan-Can Ekinci 2 years ago
parent
commit
78b7b047b8
  1. 8
      src/main/java/Gui/GameGui.java
  2. 2
      src/main/java/Gui/GameGuiInterface.java

8
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 JPanel MainPanel, ButtonPanel, headingPanel, WinningPanel, LosingPanel;
public static JLabel Headline,QuestionLabel,WinningLabel, LosingLabel; public static JLabel Headline,QuestionLabel,WinningLabel, LosingLabel;
public static JButton AnswersBtn1,AnswersBtn2,AnswersBtn3,AnswersBtn4;
public static JButton AnswersBtn1,AnswersBtn2,AnswersBtn3,AnswersBtn4,RestartBtn;
public static int questionNr = 0; public static int questionNr = 0;
GridLayout grid; GridLayout grid;
GridBagConstraints gbc; GridBagConstraints gbc;
@ -126,4 +126,10 @@ GridBagConstraints gbc;
AnswersBtn4.addActionListener(new loadNextQuestion()); AnswersBtn4.addActionListener(new loadNextQuestion());
MainPanel.add(ButtonPanel); MainPanel.add(ButtonPanel);
} }
@Override
public void createRestartButton() {
RestartBtn = new JButton("Neustarten");
LosingPanel.add(RestartBtn);
}
} }

2
src/main/java/Gui/GameGuiInterface.java

@ -18,4 +18,6 @@ public interface GameGuiInterface {
void createButtons(); void createButtons();
void createRestartButton();
} }
Loading…
Cancel
Save