Browse Source

displaying QuestionNr Label in MainPanel

master
Ozan-Can Ekinci 2 years ago
parent
commit
263d664e2f
  1. 2
      src/main/java/Gui/GameGui.java
  2. 2
      src/main/java/Gui/GameGuiInterface.java
  3. 1
      src/main/java/Gui/StartGameGui.java
  4. 1
      src/main/java/game/loadNextQuestion.java

2
src/main/java/Gui/GameGui.java

@ -102,6 +102,7 @@ GridBagConstraints gbc;
gui.Frame.add(WinningPanel); gui.Frame.add(WinningPanel);
} }
@Override
public void createShowQuestion() { public void createShowQuestion() {
int money[] = {10,20,30,40,50,60,70,80,90,100,110,120,130,140,150}; int money[] = {10,20,30,40,50,60,70,80,90,100,110,120,130,140,150};
String questionText = "Hier wird die Frage stehen"; String questionText = "Hier wird die Frage stehen";
@ -114,6 +115,7 @@ GridBagConstraints gbc;
public void createHeadline() { public void createHeadline() {
Headline = new JLabel("Wer wird Millionaer?"); Headline = new JLabel("Wer wird Millionaer?");
headingPanel.add(Headline); headingPanel.add(Headline);
ShowQuestionNr = new JLabel();
MainPanel.add(headingPanel); MainPanel.add(headingPanel);
Headline.setHorizontalAlignment(JLabel.CENTER); Headline.setHorizontalAlignment(JLabel.CENTER);
Headline.setFont(new Font("Serif", Font.BOLD, 28)); Headline.setFont(new Font("Serif", Font.BOLD, 28));

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

@ -18,4 +18,6 @@ public interface GameGuiInterface {
void createButtons(); void createButtons();
void createShowQuestion();
} }

1
src/main/java/Gui/StartGameGui.java

@ -19,5 +19,6 @@ public class StartGameGui implements ActionListener {
runGame rungame = new runGame(); runGame rungame = new runGame();
rungame.run(GameGui.questionNr); rungame.run(GameGui.questionNr);
Gui.createShowQuestion();
} }
} }

1
src/main/java/game/loadNextQuestion.java

@ -52,6 +52,7 @@ public class loadNextQuestion implements ActionListener {
public void loadQuestions() { public void loadQuestions() {
if (GameGui.questionNr != runGame.arrQuestions.length - 1) { if (GameGui.questionNr != runGame.arrQuestions.length - 1) {
StartGame.run(GameGui.questionNr); StartGame.run(GameGui.questionNr);
gameStatus.createShowQuestion();
} else { } else {
gameStatus.createWinningPanel(); gameStatus.createWinningPanel();
} }

Loading…
Cancel
Save