Browse Source

created winningpanel method

master
Ozan-Can Ekinci 2 years ago
parent
commit
11203381de
  1. 15
      src/main/java/Gui/GameGui.java
  2. 2
      src/main/java/Gui/GameGuiInterface.java

15
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?");

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

@ -5,6 +5,8 @@ public interface GameGuiInterface {
void createGui();
void CreatePanel();
void createWinningPanel();
void createHeadline();

Loading…
Cancel
Save