|
@ -46,13 +46,29 @@ GridBagConstraints gbc; |
|
|
public void createLosingPanel() { |
|
|
public void createLosingPanel() { |
|
|
MainPanel.setVisible(false); |
|
|
MainPanel.setVisible(false); |
|
|
ButtonPanel.setVisible(false); |
|
|
ButtonPanel.setVisible(false); |
|
|
|
|
|
|
|
|
|
|
|
GridBagConstraints gbc = new GridBagConstraints(); |
|
|
|
|
|
gbc.gridwidth = GridBagConstraints.REMAINDER; |
|
|
|
|
|
gbc.fill = GridBagConstraints.HORIZONTAL; |
|
|
|
|
|
gbc.ipadx = 200; |
|
|
|
|
|
gbc.ipady = 100; |
|
|
|
|
|
gbc.insets = new Insets(20, 0, 0, 0); |
|
|
|
|
|
|
|
|
|
|
|
RestartBtn = new JButton("Neustarten"); |
|
|
|
|
|
ClosingBtn = new JButton("Schliessen"); |
|
|
|
|
|
|
|
|
LosingPanel = new JPanel(); |
|
|
LosingPanel = new JPanel(); |
|
|
LosingPanel.setLayout(new GridBagLayout()); |
|
|
LosingPanel.setLayout(new GridBagLayout()); |
|
|
LosingLabel = new JLabel("Du hast Verloren!"); |
|
|
LosingLabel = new JLabel("Du hast Verloren!"); |
|
|
LosingLabel.setVerticalAlignment(JLabel.CENTER); |
|
|
LosingLabel.setVerticalAlignment(JLabel.CENTER); |
|
|
LosingLabel.setHorizontalAlignment(JLabel.CENTER); |
|
|
LosingLabel.setHorizontalAlignment(JLabel.CENTER); |
|
|
LosingLabel.setFont(new Font("Serif", Font.BOLD, 28)); |
|
|
LosingLabel.setFont(new Font("Serif", Font.BOLD, 28)); |
|
|
LosingPanel.add(LosingLabel); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LosingPanel.add(LosingLabel,gbc); |
|
|
|
|
|
LosingPanel.add(RestartBtn,gbc); |
|
|
|
|
|
LosingPanel.add(ClosingBtn,gbc); |
|
|
|
|
|
RestartBtn.addActionListener(new ActionHandler()); |
|
|
|
|
|
ClosingBtn.addActionListener(new ActionHandler()); |
|
|
gui.Frame.add(LosingPanel); |
|
|
gui.Frame.add(LosingPanel); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -128,22 +144,5 @@ GridBagConstraints gbc; |
|
|
MainPanel.add(ButtonPanel); |
|
|
MainPanel.add(ButtonPanel); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public void createRestartButton() { |
|
|
|
|
|
GridBagConstraints gbc = new GridBagConstraints(); |
|
|
|
|
|
gbc.gridwidth = GridBagConstraints.REMAINDER; |
|
|
|
|
|
gbc.fill = GridBagConstraints.HORIZONTAL; |
|
|
|
|
|
gbc.ipadx = 200; |
|
|
|
|
|
gbc.ipady = 100; |
|
|
|
|
|
gbc.insets = new Insets(20, 0, 0, 0); |
|
|
|
|
|
RestartBtn = new JButton("Neustarten"); |
|
|
|
|
|
ClosingBtn = new JButton("Schliessen"); |
|
|
|
|
|
|
|
|
|
|
|
LosingPanel.add(LosingLabel,gbc); |
|
|
|
|
|
LosingPanel.add(RestartBtn,gbc); |
|
|
|
|
|
LosingPanel.add(ClosingBtn,gbc); |
|
|
|
|
|
|
|
|
|
|
|
RestartBtn.addActionListener(new ActionHandler()); |
|
|
|
|
|
ClosingBtn.addActionListener(new ActionHandler()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |