Browse Source

player_management: added layout for LoginPanel

Tobias Krause 3 years ago
committed by Lorenz Hohmann
parent
commit
9dc32c8ff2
  1. 25
      src/main/java/de/tims/gameexplorer/GameExplorer.java

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

@ -2,6 +2,7 @@ package de.tims.gameexplorer;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class GameExplorer {
@ -31,6 +32,7 @@ public class GameExplorer {
private JLabel chosenGame;
private JTextField usernameInput;
private Dimension minSize;
private Dimension loginBtnSize;
private Dimension btnSize;
private GridBagConstraints gbc;
@ -41,6 +43,7 @@ public class GameExplorer {
frame = new JFrame("1000 infomagische Spiele");
minSize = new Dimension(400, 300);
loginBtnSize = new Dimension(91, 20);
btnSize = new Dimension(160, 40);
gbc = new GridBagConstraints();
@ -134,14 +137,28 @@ public class GameExplorer {
private void buildLoginPanel() {
loginPanel = new JPanel();
loginPanel.setLayout(new GridBagLayout());
loginBtn = new JButton("Login");
loginBtn.setPreferredSize(loginBtnSize);
username = new JLabel("Name eingeben:");
usernameInput = new JTextField(10);
usernameInput = new JTextField(8);
loginPanel.add(username);
loginPanel.add(usernameInput);
loginPanel.add(loginBtn);
gbc.weighty = 0;
gbc.gridx = 0;
gbc.gridy = 0;
gbc.insets = new Insets(0, 0, 5, 0);
loginPanel.add(username, gbc);
gbc.gridx = 0;
gbc.gridy = 1;
gbc.insets = new Insets(5, 0, 5, 0);
loginPanel.add(usernameInput, gbc);
gbc.gridx = 0;
gbc.gridy = 2;
gbc.insets = new Insets(5, 0, 0, 0);
loginPanel.add(loginBtn, gbc);
}
private void buildNavigationPanel() {

Loading…
Cancel
Save