import [Link].
*;
import [Link].*;
import [Link].*;
public class LoginForm implements ActionListener {
JFrame frame;
JLabel userLabel, passLabel;
JTextField userText;
JPasswordField passText;
JButton loginBtn;
LoginForm() {
frame = new JFrame("Login Form");
[Link](350, 250);
[Link](null);
[Link](JFrame.EXIT_ON_CLOSE);
userLabel = new JLabel("Username:");
[Link](40, 40, 80, 25);
userText = new JTextField();
[Link](130, 40, 150, 25);
passLabel = new JLabel("Password:");
[Link](40, 80, 80, 25);
passText = new JPasswordField();
[Link](130, 80, 150, 25);
loginBtn = new JButton("Login");
[Link](130, 130, 80, 30);
[Link](this);
[Link](userLabel);
[Link](userText);
[Link](passLabel);
[Link](passText);
[Link](loginBtn);
[Link](true);
}
public static void main(String[] args) {
new LoginForm();
}
@Override
public void actionPerformed(ActionEvent e) {
String user = [Link]();
String pass = new String([Link]());
if ([Link]("admin") && [Link]("1234")) {
[Link](frame, "Login Successful ✅");
} else {
[Link](frame, "Invalid Username or Password ❌");
}
}
}