Advertisement
Guest User

Untitled

a guest
Oct 18th, 2016
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package ObjectClass;
  7.  
  8. import javax.swing.JFrame;
  9. import javax.swing.JLabel;
  10. import javax.swing.JPasswordField;
  11. import javax.swing.JTextField;
  12.  
  13. /**
  14. *
  15. * @author amferranco
  16. */
  17. public class LogInForm {
  18. private JFrame jfLogin;
  19. private JLabel jlUser, jlPass;
  20. private JTextField jtfUser;
  21. private JPasswordField jtfPass;
  22.  
  23. public LogInForm(){
  24. jfLogin = new JFrame("Log In");
  25. jlUser = new JLabel("Username");
  26. jlPass = new JLabel("Password");
  27. jtfUser=new JTextField();
  28. jtfPass=new JPasswordField();
  29.  
  30. }
  31. public void launch(){
  32. jfLogin.setLayout(null);
  33. jfLogin.setBounds(160, 150, 400, 300);
  34. jfLogin.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  35. jlUser.setBounds(30, 50, 100, 30);
  36. jfLogin.add(jlUser);
  37. jlPass.setBounds(30,100,100,30);
  38. jfLogin.add(jlPass);
  39. jfLogin.setVisible(true);
  40.  
  41. }
  42. }
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53. /*
  54. * To change this license header, choose License Headers in Project Properties.
  55. * To change this template file, choose Tools | Templates
  56. * and open the template in the editor.
  57. */
  58. package TestClass;
  59.  
  60. import ObjectClass.LogInForm;
  61.  
  62. /**
  63. *
  64. * @author amferranco
  65. */
  66. public class TestLogIn {
  67. public static void main(String[] args){
  68. new LogInForm().launch();
  69. }
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement