diff --git a/src/main/java/Gui/GameGui.java b/src/main/java/Gui/GameGui.java index 5a35231..1649804 100644 --- a/src/main/java/Gui/GameGui.java +++ b/src/main/java/Gui/GameGui.java @@ -46,7 +46,8 @@ GridBagConstraints gbc; public void createLosingPanel() { MainPanel.setVisible(false); ButtonPanel.setVisible(false); - LosingPanel = new JPanel(new GridLayout()); + LosingPanel = new JPanel(); + LosingPanel.setLayout(new GridBagLayout()); LosingLabel = new JLabel("Du hast Verloren!"); LosingLabel.setVerticalAlignment(JLabel.CENTER); LosingLabel.setHorizontalAlignment(JLabel.CENTER); @@ -129,8 +130,11 @@ GridBagConstraints gbc; @Override public void createRestartButton() { + GridBagConstraints gbc = new GridBagConstraints(); RestartBtn = new JButton("Neustarten"); - LosingPanel.add(RestartBtn); + LosingPanel.add(LosingLabel,gbc); + LosingPanel.add(RestartBtn,gbc); + RestartBtn.addActionListener(new RestartGame()); } }