From 5903ad63755ffe90ca42577b5fe38c343ffc38fb Mon Sep 17 00:00:00 2001 From: Tobias Krause Date: Mon, 27 Dec 2021 16:34:52 +0100 Subject: [PATCH] gameexplorer: added layout for navigation panel --- .../de/tims/gameexplorer/GameExplorer.java | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/tims/gameexplorer/GameExplorer.java b/src/main/java/de/tims/gameexplorer/GameExplorer.java index f174d1f..9e78247 100644 --- a/src/main/java/de/tims/gameexplorer/GameExplorer.java +++ b/src/main/java/de/tims/gameexplorer/GameExplorer.java @@ -13,6 +13,7 @@ public class GameExplorer { private JPanel border3; private JPanel border4; private JPanel border5; + private JPanel border6; private JButton fleetstormBtn; private JButton fourwinsBtn; private JButton tictactoeBtn; @@ -114,13 +115,33 @@ public class GameExplorer { private void buildNavigationPanel() { navigationPanel = new JPanel(); + navigationPanel.setLayout(new GridBagLayout()); backBtn = new JButton("< Zurück"); chosenGame = new JLabel(); - navigationPanel.add(backBtn); - navigationPanel.add(chosenGame); + border6 = new JPanel(); + border6.setOpaque(false); + + gbc.weighty = 0.0; + gbc.gridx = 0; + gbc.gridy = 0; + gbc.weightx = 0.0; + gbc.insets = new Insets(5, 20, 5, 0); + navigationPanel.add(backBtn, gbc); + + gbc.gridx = 1; + gbc.gridy = 0; + gbc.weightx = 1.0; + gbc.insets = new Insets(0, 0, 0, 0); + navigationPanel.add(border6, gbc); + + gbc.gridx = 2; + gbc.gridy = 0; + gbc.weightx = 0.0; + gbc.insets = new Insets(5, 0, 5, 20); + navigationPanel.add(chosenGame, gbc); } public static void main(String[] args) {