Browse Source

implemented method to check if the second answer is correct

master
Ozan-Can Ekinci 2 years ago
parent
commit
e87d1ad9d1
  1. 2
      QandA/Answers.txt
  2. 2
      src/main/java/Gui/GameGui.java
  3. 11
      src/main/java/game/loadNextQuestion.java

2
QandA/Answers.txt

@ -1,4 +1,4 @@
right,wrong,wrong,wrong,1
-,-,-,-,2
wrong,right,wrong,right,2
-,-,-,-,3
-,-,-,-,4

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

@ -43,7 +43,7 @@ GridBagConstraints gbc;
}
@Override
public void createHeadline() {
Headline = new JLabel("Wer wird Millionr?");
Headline = new JLabel("Wer wird Millionär?");
headingPanel.add(Headline);
MainPanel.add(headingPanel);
Headline.setHorizontalAlignment(JLabel.CENTER);

11
src/main/java/game/loadNextQuestion.java

@ -21,6 +21,17 @@ public class loadNextQuestion implements ActionListener {
}
}
else if (runGame.splitAns[4].equals("2")) {
if (e.getSource() == GameGui.AnswersBtn2) {
if (GameGui.questionNr != runGame.arrQuestions.length - 1) {
runGame StartGame = new runGame();
StartGame.run(GameGui.questionNr);
}
} else {
System.exit(0);
}
}
}

Loading…
Cancel
Save