From 26b71db18103ce04788ec902cd5159c8a358aadf Mon Sep 17 00:00:00 2001 From: Ozan-Can Ekinci Date: Wed, 11 Jan 2023 21:54:44 +0100 Subject: [PATCH] adjusted GridBagLayout for Restart button --- src/main/java/Gui/GameGui.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/Gui/GameGui.java b/src/main/java/Gui/GameGui.java index 1649804..4b95681 100644 --- a/src/main/java/Gui/GameGui.java +++ b/src/main/java/Gui/GameGui.java @@ -131,10 +131,15 @@ GridBagConstraints gbc; @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"); + LosingPanel.add(LosingLabel,gbc); LosingPanel.add(RestartBtn,gbc); - RestartBtn.addActionListener(new RestartGame()); } }