From 061af6313f155018174364cd7f10519aed3b09b0 Mon Sep 17 00:00:00 2001 From: Richard Schmidt Date: Wed, 7 Feb 2024 11:24:42 +0100 Subject: [PATCH] Added textfield for username input --- src/main/java/LoginGUI.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/LoginGUI.java b/src/main/java/LoginGUI.java index 31fc2f2..b4e90a2 100644 --- a/src/main/java/LoginGUI.java +++ b/src/main/java/LoginGUI.java @@ -4,6 +4,7 @@ import java.awt.event.ActionListener; import java.util.List; public class LoginGUI extends JFrame implements ActionListener { + private JTextField usernameField; public LoginGUI() { setTitle("Login"); @@ -11,6 +12,13 @@ public class LoginGUI extends JFrame implements ActionListener { setDefaultCloseOperation(EXIT_ON_CLOSE); setLayout(null); + JLabel usernameLabel = new JLabel("Username:"); + usernameLabel.setBounds(20, 20, 80, 25); + add(usernameLabel); + + usernameField = new JTextField(); + usernameField.setBounds(100, 20, 160, 25); + add(usernameField); }