Browse Source

player_management: added LoginPanel to gameexplorer

Tobias Krause 3 years ago
committed by Lorenz Hohmann
parent
commit
24dc1a07d1
  1. 19
      src/main/java/de/tims/gameexplorer/GameExplorer.java

19
src/main/java/de/tims/gameexplorer/GameExplorer.java

@ -8,6 +8,7 @@ public class GameExplorer {
private JFrame frame; private JFrame frame;
private JPanel explorerPanel; private JPanel explorerPanel;
private JPanel loginPanel;
private JPanel gamePanel; private JPanel gamePanel;
private JPanel navigationPanel; private JPanel navigationPanel;
private JPanel fleetstormPanel; private JPanel fleetstormPanel;
@ -20,12 +21,15 @@ public class GameExplorer {
private JPanel border4; private JPanel border4;
private JPanel border5; private JPanel border5;
private JPanel border6; private JPanel border6;
private JButton loginBtn;
private JButton fleetstormBtn; private JButton fleetstormBtn;
private JButton fourwinsBtn; private JButton fourwinsBtn;
private JButton tictactoeBtn; private JButton tictactoeBtn;
private JButton leaderboardBtn; private JButton leaderboardBtn;
private JButton backBtn; private JButton backBtn;
private JLabel username;
private JLabel chosenGame; private JLabel chosenGame;
private JTextField usernameInput;
private Dimension minSize; private Dimension minSize;
private Dimension btnSize; private Dimension btnSize;
private GridBagConstraints gbc; private GridBagConstraints gbc;
@ -41,10 +45,11 @@ public class GameExplorer {
gbc = new GridBagConstraints(); gbc = new GridBagConstraints();
buildExplorerPanel(); buildExplorerPanel();
buildLoginPanel();
buildNavigationPanel(); buildNavigationPanel();
buildGamePanels(); buildGamePanels();
frame.add(explorerPanel);
frame.add(loginPanel);
frame.setMinimumSize(minSize); frame.setMinimumSize(minSize);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
@ -127,6 +132,18 @@ public class GameExplorer {
explorerPanel.add(border5, gbc); 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() { private void buildNavigationPanel() {
navigationPanel = new JPanel(); navigationPanel = new JPanel();
navigationPanel.setLayout(new GridBagLayout()); navigationPanel.setLayout(new GridBagLayout());

Loading…
Cancel
Save