From e87d1ad9d1b0ecda67a72da461c113739ca485c7 Mon Sep 17 00:00:00 2001 From: Ozan-Can Ekinci Date: Mon, 9 Jan 2023 01:41:13 +0100 Subject: [PATCH] implemented method to check if the second answer is correct --- QandA/Answers.txt | 2 +- src/main/java/Gui/GameGui.java | 2 +- src/main/java/game/loadNextQuestion.java | 11 +++++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/QandA/Answers.txt b/QandA/Answers.txt index b292e21..0779f68 100644 --- a/QandA/Answers.txt +++ b/QandA/Answers.txt @@ -1,4 +1,4 @@ right,wrong,wrong,wrong,1 --,-,-,-,2 +wrong,right,wrong,right,2 -,-,-,-,3 -,-,-,-,4 \ No newline at end of file diff --git a/src/main/java/Gui/GameGui.java b/src/main/java/Gui/GameGui.java index 71e4825..11cdc60 100644 --- a/src/main/java/Gui/GameGui.java +++ b/src/main/java/Gui/GameGui.java @@ -43,7 +43,7 @@ GridBagConstraints gbc; } @Override public void createHeadline() { - Headline = new JLabel("Wer wird Million�r?"); + Headline = new JLabel("Wer wird Millionär?"); headingPanel.add(Headline); MainPanel.add(headingPanel); Headline.setHorizontalAlignment(JLabel.CENTER); diff --git a/src/main/java/game/loadNextQuestion.java b/src/main/java/game/loadNextQuestion.java index a4fc7f7..1b2d1b2 100644 --- a/src/main/java/game/loadNextQuestion.java +++ b/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); + } + } + }