Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.swing.JFrame;
- import javax.swing.JLabel;
- import javax.swing.JTextField;
- import javax.swing.JButton;
- import java.awt.event.ActionListener;
- @SuppressWarnings("serial")
- public class Login extends JFrame{
- public JTextField username;
- public JTextField password;
- public JButton btnLogin = new JButton("Login");
- public JButton btnRegister = new JButton("Register");
- public JLabel mesaj = new JLabel("");
- public Login() {
- getContentPane().setLayout(null);
- JLabel lblUsername = new JLabel("Username:");
- lblUsername.setBounds(78, 55, 82, 23);
- getContentPane().add(lblUsername);
- JLabel lblPassword = new JLabel("Password:");
- lblPassword.setBounds(78, 130, 82, 23);
- getContentPane().add(lblPassword);
- username = new JTextField();
- username.setBounds(170, 56, 155, 20);
- getContentPane().add(username);
- username.setColumns(10);
- password = new JTextField();
- password.setBounds(170, 130, 155, 23);
- getContentPane().add(password);
- password.setColumns(10);
- btnRegister.setBounds(43, 188, 106, 34);
- getContentPane().add(btnRegister);
- btnLogin.setBounds(265, 188, 106, 34);
- getContentPane().add(btnLogin);
- mesaj.setBounds(134, 233, 257, 17);
- getContentPane().add(mesaj);
- }
- public void register(ActionListener e) {
- btnRegister.addActionListener(e);
- }
- public void logare (ActionListener e) {
- btnLogin.addActionListener(e);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement