Advertisement
Guest User

Untitled

a guest
Jan 5th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. import javax.swing.JFrame;
  2. import javax.swing.JLabel;
  3. import javax.swing.JTextField;
  4. import javax.swing.JButton;
  5. import java.awt.event.ActionListener;
  6.  
  7. @SuppressWarnings("serial")
  8. public class Login extends JFrame{
  9. public JTextField username;
  10. public JTextField password;
  11. public JButton btnLogin = new JButton("Login");
  12. public JButton btnRegister = new JButton("Register");
  13. public JLabel mesaj = new JLabel("");
  14. public Login() {
  15. getContentPane().setLayout(null);
  16.  
  17. JLabel lblUsername = new JLabel("Username:");
  18. lblUsername.setBounds(78, 55, 82, 23);
  19. getContentPane().add(lblUsername);
  20.  
  21. JLabel lblPassword = new JLabel("Password:");
  22. lblPassword.setBounds(78, 130, 82, 23);
  23. getContentPane().add(lblPassword);
  24.  
  25. username = new JTextField();
  26. username.setBounds(170, 56, 155, 20);
  27. getContentPane().add(username);
  28. username.setColumns(10);
  29.  
  30. password = new JTextField();
  31. password.setBounds(170, 130, 155, 23);
  32. getContentPane().add(password);
  33. password.setColumns(10);
  34.  
  35.  
  36.  
  37. btnRegister.setBounds(43, 188, 106, 34);
  38. getContentPane().add(btnRegister);
  39.  
  40.  
  41.  
  42. btnLogin.setBounds(265, 188, 106, 34);
  43. getContentPane().add(btnLogin);
  44. mesaj.setBounds(134, 233, 257, 17);
  45.  
  46. getContentPane().add(mesaj);
  47.  
  48. }
  49. public void register(ActionListener e) {
  50. btnRegister.addActionListener(e);
  51.  
  52. }
  53. public void logare (ActionListener e) {
  54. btnLogin.addActionListener(e);
  55.  
  56. }
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement