|
|
@ -17,8 +17,8 @@ import game.runGame; |
|
|
|
public class GameGui implements GameGuiInterface { |
|
|
|
|
|
|
|
public static JPanel MainPanel, ButtonPanel, headingPanel, WinningPanel, LosingPanel; |
|
|
|
public static JLabel Headline,QuestionLabel,WinningLabel, LosingLabel, ShowQuestionNr, HighScoreLabel; |
|
|
|
public static JButton AnswersBtn1,AnswersBtn2,AnswersBtn3,AnswersBtn4,RestartBtn,RestartBtn1,ClosingBtn; |
|
|
|
public static JLabel Headline, QuestionLabel, WinningLabel, LosingLabel, ShowQuestionNr, HighScoreLabel; |
|
|
|
public static JButton AnswersBtn1, AnswersBtn2, AnswersBtn3, AnswersBtn4, RestartBtn, RestartBtn1, ClosingBtn; |
|
|
|
public static int questionNr = 0; |
|
|
|
public static int counter = 1; |
|
|
|
public static int highScore = 0; |
|
|
@ -110,7 +110,7 @@ GridBagConstraints gbc; |
|
|
|
public void createShowQuestion(int i) { |
|
|
|
int numLines = runGame.CountFileLines("QandA/Money.txt"); |
|
|
|
String[] arrMoney = runGame.readFile("QandA/Money.txt", numLines); |
|
|
|
String questionText = "Frage " + counter + ": " + arrMoney[i - 1] + "€"; |
|
|
|
String questionText = "Frage " + counter + ": " + arrMoney[i - 1] + " Euro"; |
|
|
|
counter++; |
|
|
|
|
|
|
|
ShowQuestionNr.setText(questionText); |
|
|
@ -133,6 +133,7 @@ GridBagConstraints gbc; |
|
|
|
MainPanel.add(QuestionLabel); |
|
|
|
QuestionLabel.setHorizontalAlignment(JLabel.CENTER); |
|
|
|
QuestionLabel.setVerticalAlignment(JLabel.NORTH); |
|
|
|
QuestionLabel.setFont(new Font("Serif", Font.BOLD, 20)); |
|
|
|
headingPanel.add(QuestionLabel); |
|
|
|
} |
|
|
|
|
|
|
|