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