Browse Source

refactoring: adjusted QuestionLabel size

master
Ozan-Can Ekinci 2 years ago
parent
commit
32dc8a0793
  1. 7
      src/main/java/Gui/GameGui.java

7
src/main/java/Gui/GameGui.java

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

Loading…
Cancel
Save