Advertisement
Guest User

Pogi ako

a guest
Oct 18th, 2016
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. import javax.swing.*;
  2.  
  3. public class LogInForm{
  4. private JFrame jfLogIn;
  5. private JLabel jlUser, jlPass;
  6. private JTextField jtfUser;
  7. private JPasswordField jpPass;
  8. private JButton jbOk, jbCancel;
  9. public LogInForm(){
  10. jfLogIn = new JFrame("Log In");
  11. jlUser = new JLabel("UserName: ");
  12. jlPass = new JLabel("Password: ");
  13. jtfUser = new JTextField();
  14. jpPass = new JPasswordField();
  15. jbOk = new JButton("Ok");
  16. jbCancel = new JButton("Cancel");
  17. }
  18.  
  19. public void launch(){
  20. jfLogIn.setLayout(null);
  21. jfLogIn.setBounds(160, 150, 400, 300);
  22. jfLogIn.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  23. jlUser.setBounds(30 ,50 ,100 ,30);
  24. jfLogIn.add(jlUser);
  25. jlPass.setBounds(30 ,100 ,100 ,30);
  26. jfLogIn.add(jlPass);
  27. jtfUser.setBounds(150, 50, 200, 30);
  28. jfLogIn.add(jtfUser);
  29. jpPass.setBounds(150, 100, 200, 30);
  30. jfLogIn.add(jpPass);
  31. jbOk.setBounds(50, 150, 100, 30);
  32. jfLogIn.add(jbOk);
  33. jbCancel.setBounds(250, 150, 100, 30);
  34. jfLogIn.add(jbCancel);
  35. jfLogIn.setVisible(true);
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement