Guest User

Untitled

a guest
Aug 6th, 2018
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.30 KB | None | 0 0
  1. /*
  2. * To change this template, choose Tools | Templates
  3. * and open the template in the editor.
  4. */
  5.  
  6. /*
  7. * LoginFrame.java
  8. *
  9. * Created on Jul 26, 2010, 2:31:50 AM
  10. */
  11.  
  12. /**
  13. *
  14. * @author M
  15. */
  16. public class LoginFrame extends javax.swing.JFrame {
  17.  
  18. /** Creates new form LoginFrame */
  19. public LoginFrame() {
  20. initComponents();
  21. }
  22.  
  23. /** This method is called from within the constructor to
  24. * initialize the form.
  25. * WARNING: Do NOT modify this code. The content of this method is
  26. * always regenerated by the Form Editor.
  27. */
  28. @SuppressWarnings("unchecked")
  29. // <editor-fold defaultstate="collapsed" desc="Generated Code">
  30. private void initComponents() {
  31.  
  32. jLabel1 = new javax.swing.JLabel();
  33. jLabel2 = new javax.swing.JLabel();
  34. usernameBox = new javax.swing.JTextField();
  35. jLabel3 = new javax.swing.JLabel();
  36. remembermeCheckbox = new javax.swing.JCheckBox();
  37. loginButton = new javax.swing.JButton();
  38. passwordBox = new javax.swing.JPasswordField();
  39.  
  40. setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
  41. setTitle("Login");
  42. setResizable(false);
  43.  
  44. jLabel1.setText("Please enter your login information:");
  45.  
  46. jLabel2.setText("Username:");
  47.  
  48. jLabel3.setText("Password:");
  49.  
  50. remembermeCheckbox.setText("Remember Me");
  51.  
  52. loginButton.setText("Log In!");
  53. loginButton.addActionListener(new java.awt.event.ActionListener() {
  54. public void actionPerformed(java.awt.event.ActionEvent evt) {
  55. loginButtonActionPerformed(evt);
  56. }
  57. });
  58.  
  59. javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
  60. getContentPane().setLayout(layout);
  61. layout.setHorizontalGroup(
  62. layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  63. .addGroup(layout.createSequentialGroup()
  64. .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  65. .addGroup(layout.createSequentialGroup()
  66. .addContainerGap()
  67. .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  68. .addComponent(jLabel1)
  69. .addGroup(layout.createSequentialGroup()
  70. .addGap(10, 10, 10)
  71. .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
  72. .addComponent(usernameBox, javax.swing.GroupLayout.DEFAULT_SIZE, 198, Short.MAX_VALUE)
  73. .addComponent(jLabel2)
  74. .addComponent(jLabel3)
  75. .addComponent(remembermeCheckbox)
  76. .addComponent(passwordBox)))))
  77. .addGroup(layout.createSequentialGroup()
  78. .addGap(32, 32, 32)
  79. .addComponent(loginButton)))
  80. .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
  81. );
  82. layout.setVerticalGroup(
  83. layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  84. .addGroup(layout.createSequentialGroup()
  85. .addContainerGap()
  86. .addComponent(jLabel1)
  87. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  88. .addComponent(jLabel2)
  89. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  90. .addComponent(usernameBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  91. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
  92. .addComponent(jLabel3)
  93. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  94. .addComponent(passwordBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  95. .addGap(7, 7, 7)
  96. .addComponent(remembermeCheckbox)
  97. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  98. .addComponent(loginButton)
  99. .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
  100. );
  101.  
  102. pack();
  103. }// </editor-fold>
  104.  
  105. private void loginButtonActionPerformed(java.awt.event.ActionEvent evt) {
  106. dispose();
  107. }
  108.  
  109. /**
  110. * @param args the command line arguments
  111. */
  112. public static void main(String args[]) {
  113. java.awt.EventQueue.invokeLater(new Runnable() {
  114. public void run() {
  115. new LoginFrame().setVisible(true);
  116. }
  117. });
  118. }
  119.  
  120. // Variables declaration - do not modify
  121. private javax.swing.JLabel jLabel1;
  122. private javax.swing.JLabel jLabel2;
  123. private javax.swing.JLabel jLabel3;
  124. private javax.swing.JButton loginButton;
  125. private javax.swing.JPasswordField passwordBox;
  126. private javax.swing.JCheckBox remembermeCheckbox;
  127. private javax.swing.JTextField usernameBox;
  128. // End of variables declaration
  129.  
  130. }
Add Comment
Please, Sign In to add comment