Advertisement
Guest User

Untitled

a guest
Mar 3rd, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.18 KB | None | 0 0
  1. import java.awt.EventQueue;
  2.  
  3. import javax.swing.JFrame;
  4. import javax.swing.JInternalFrame;
  5. import java.awt.BorderLayout;
  6. import javax.swing.JPanel;
  7. import java.awt.Color;
  8. import java.awt.FlowLayout;
  9. import javax.swing.JLabel;
  10. import javax.swing.JTextField;
  11. import javax.swing.JPasswordField;
  12. import javax.swing.JButton;
  13. import java.awt.event.ActionListener;
  14. import java.awt.event.ActionEvent;
  15. import javax.swing.SwingConstants;
  16.  
  17. public class Login {
  18.  
  19. private JFrame frame;
  20. private JTextField txtUsername;
  21. private JPasswordField pwdPassword;
  22. private JButton btnNewButton_1;
  23.  
  24. /**
  25. * Launch the application.
  26. */
  27. public static void main(String[] args) {
  28. EventQueue.invokeLater(new Runnable() {
  29. public void run() {
  30. try {
  31. Login window = new Login();
  32. window.frame.setVisible(true);
  33. } catch (Exception e) {
  34. e.printStackTrace();
  35. }
  36. }
  37. });
  38. }
  39.  
  40. /**
  41. * Create the application.
  42. */
  43. public Login() {
  44. initialize();
  45. }
  46.  
  47. /**
  48. * Initialize the contents of the frame.
  49. */
  50. private void initialize() {
  51. frame = new JFrame();
  52. frame.setBounds(100, 100, 484, 354);
  53. frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  54. frame.getContentPane().setLayout(null);
  55.  
  56. JPanel panel = new JPanel();
  57. panel.setBackground(Color.GRAY);
  58. panel.setBounds(56, 48, 367, 207);
  59. frame.getContentPane().add(panel);
  60. panel.setLayout(null);
  61.  
  62. txtUsername = new JTextField();
  63. txtUsername.setToolTipText("hi\r\n");
  64. txtUsername.setHorizontalAlignment(SwingConstants.LEFT);
  65. txtUsername.setText("Username");
  66. txtUsername.setBounds(80, 49, 233, 20);
  67. panel.add(txtUsername);
  68. txtUsername.setColumns(10);
  69.  
  70. pwdPassword = new JPasswordField();
  71. pwdPassword.setText("Password");
  72. pwdPassword.setBounds(80, 80, 233, 20);
  73. panel.add(pwdPassword);
  74.  
  75. JButton btnNewButton = new JButton("Login");
  76. btnNewButton.addActionListener(new ActionListener() {
  77. public void actionPerformed(ActionEvent arg0) {
  78. }
  79. });
  80. btnNewButton.setBounds(80, 111, 233, 20);
  81. panel.add(btnNewButton);
  82.  
  83. btnNewButton_1 = new JButton("Create new user");
  84. btnNewButton_1.setBounds(80, 142, 233, 20);
  85. panel.add(btnNewButton_1);
  86. }
  87. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement