|
|
@ -11,7 +11,7 @@ import javax.swing.JLabel; |
|
|
|
import javax.swing.JPanel; |
|
|
|
|
|
|
|
|
|
|
|
public class GameGui { |
|
|
|
public class GameGui implements GameGuiInterface { |
|
|
|
|
|
|
|
public static JPanel MainPanel, ButtonPanel, headingPanel; |
|
|
|
public static JLabel Headline,QuestionLabel; |
|
|
@ -20,6 +20,7 @@ public static int questionNr = 0; |
|
|
|
GridLayout grid; |
|
|
|
GridBagConstraints gbc; |
|
|
|
|
|
|
|
@Override |
|
|
|
public void createGui() { |
|
|
|
CreatePanel(); |
|
|
|
createHeadline(); |
|
|
@ -28,6 +29,7 @@ GridBagConstraints gbc; |
|
|
|
createButtons(); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void CreatePanel(){ |
|
|
|
MainPanel = new JPanel(); |
|
|
|
ButtonPanel = new JPanel(); |
|
|
@ -37,6 +39,7 @@ GridBagConstraints gbc; |
|
|
|
headingPanel.setLayout(grid); |
|
|
|
gui.Frame.add(MainPanel); |
|
|
|
} |
|
|
|
@Override |
|
|
|
public void createHeadline() { |
|
|
|
Headline = new JLabel("Wer wird Millionär?"); |
|
|
|
headingPanel.add(Headline); |
|
|
@ -44,6 +47,7 @@ GridBagConstraints gbc; |
|
|
|
Headline.setHorizontalAlignment(JLabel.CENTER); |
|
|
|
Headline.setFont(new Font("Serif", Font.BOLD, 28)); |
|
|
|
} |
|
|
|
@Override |
|
|
|
public void createQuestionLabel() { |
|
|
|
QuestionLabel = new JLabel("Questions"); |
|
|
|
MainPanel.add(QuestionLabel); |
|
|
@ -51,6 +55,7 @@ GridBagConstraints gbc; |
|
|
|
QuestionLabel.setVerticalAlignment(JLabel.NORTH); |
|
|
|
headingPanel.add(QuestionLabel); |
|
|
|
} |
|
|
|
@Override |
|
|
|
public void createLayout() { |
|
|
|
ButtonPanel.setLayout(new GridBagLayout()); |
|
|
|
gbc = new GridBagConstraints(); |
|
|
@ -61,6 +66,7 @@ GridBagConstraints gbc; |
|
|
|
gbc.ipady = 100; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void createButtons() { |
|
|
|
AnswersBtn1 = new JButton(); |
|
|
|
gbc.gridx = 0; |
|
|
|