From 75ca5e7f471707fadc48c25471e668ab293838f3 Mon Sep 17 00:00:00 2001 From: Tobias Krause Date: Sat, 15 Jan 2022 19:43:04 +0100 Subject: [PATCH] player_management: added LoginPanel to gameexplorer --- .../de/tims/gameexplorer/GameExplorer.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/tims/gameexplorer/GameExplorer.java b/src/main/java/de/tims/gameexplorer/GameExplorer.java index 03c23dd..8630841 100644 --- a/src/main/java/de/tims/gameexplorer/GameExplorer.java +++ b/src/main/java/de/tims/gameexplorer/GameExplorer.java @@ -8,6 +8,7 @@ public class GameExplorer { private JFrame frame; private JPanel explorerPanel; + private JPanel loginPanel; private JPanel gamePanel; private JPanel navigationPanel; private JPanel fleetstormPanel; @@ -20,12 +21,15 @@ public class GameExplorer { private JPanel border4; private JPanel border5; private JPanel border6; + private JButton loginBtn; private JButton fleetstormBtn; private JButton fourwinsBtn; private JButton tictactoeBtn; private JButton leaderboardBtn; private JButton backBtn; + private JLabel username; private JLabel chosenGame; + private JTextField usernameInput; private Dimension minSize; private Dimension btnSize; private GridBagConstraints gbc; @@ -41,10 +45,11 @@ public class GameExplorer { gbc = new GridBagConstraints(); buildExplorerPanel(); + buildLoginPanel(); buildNavigationPanel(); buildGamePanels(); - frame.add(explorerPanel); + frame.add(loginPanel); frame.setMinimumSize(minSize); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); @@ -127,6 +132,18 @@ public class GameExplorer { explorerPanel.add(border5, gbc); } + private void buildLoginPanel() { + loginPanel = new JPanel(); + + loginBtn = new JButton("Login"); + username = new JLabel("Name eingeben:"); + usernameInput = new JTextField(10); + + loginPanel.add(username); + loginPanel.add(usernameInput); + loginPanel.add(loginBtn); + } + private void buildNavigationPanel() { navigationPanel = new JPanel(); navigationPanel.setLayout(new GridBagLayout());