Browse Source

created file and String array for showing question value

master
Ozan-Can Ekinci 2 years ago
parent
commit
6c55bb0e78
  1. 15
      QandA/Money.txt
  2. 6
      src/main/java/Gui/GameGui.java

15
QandA/Money.txt

@ -0,0 +1,15 @@
50
100
200
300
500
1.000
2.000
4.000
8.000
16.000
32.000
64.000
125.000
500.000
1.000.000

6
src/main/java/Gui/GameGui.java

@ -11,6 +11,7 @@ import javax.swing.JLabel;
import javax.swing.JPanel;
import game.loadNextQuestion;
import game.runGame;
public class GameGui implements GameGuiInterface {
@ -107,8 +108,9 @@ GridBagConstraints gbc;
@Override
public void createShowQuestion(int i) {
int money[] = {10,20,30,40,50,60,70,80,90,100,110,120,130,140,150};
String questionText = "Frage " + counter + ": " + money[i - 1] + "€";
int numLines = runGame.CountFileLines("QandA/Money.txt");
String[] arrMoney = runGame.readFile("QandA/Money.txt", numLines);
String questionText = "Frage " + counter + ": " + arrMoney[i - 1] + "€";
counter++;
ShowQuestionNr.setText(questionText);

Loading…
Cancel
Save