Advertisement
Guest User

java butoi

a guest
Apr 2nd, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.17 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.  
  7. /**
  8. *
  9. * @author Alex
  10. */
  11. public class Verificare extends javax.swing.JFrame {
  12.  
  13. /**
  14. * Creates new form Verificare
  15. */
  16. public Verificare() {
  17. initComponents();
  18. }
  19.  
  20. /**
  21. * This method is called from within the constructor to initialize the form.
  22. * WARNING: Do NOT modify this code. The content of this method is always
  23. * regenerated by the Form Editor.
  24. */
  25. @SuppressWarnings("unchecked")
  26. // <editor-fold defaultstate="collapsed" desc="Generated Code">
  27. private void initComponents() {
  28.  
  29. etStatus = new javax.swing.JLabel();
  30. etUser = new javax.swing.JTextField();
  31. etPass = new javax.swing.JTextField();
  32. bInregistrare = new javax.swing.JToggleButton();
  33.  
  34. setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
  35.  
  36. etStatus.setText(" ");
  37.  
  38. etUser.setText("User");
  39. etUser.addActionListener(new java.awt.event.ActionListener() {
  40. public void actionPerformed(java.awt.event.ActionEvent evt) {
  41. etUserActionPerformed(evt);
  42. }
  43. });
  44.  
  45. etPass.setText("Pass");
  46. etPass.addActionListener(new java.awt.event.ActionListener() {
  47. public void actionPerformed(java.awt.event.ActionEvent evt) {
  48. etPassActionPerformed(evt);
  49. }
  50. });
  51.  
  52. bInregistrare.setText("INREGISTRARE");
  53. bInregistrare.addActionListener(new java.awt.event.ActionListener() {
  54. public void actionPerformed(java.awt.event.ActionEvent evt) {
  55. bInregistrareActionPerformed(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. .addGap(84, 84, 84)
  65. .addComponent(bInregistrare)
  66. .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
  67. .addGroup(layout.createSequentialGroup()
  68. .addGap(68, 68, 68)
  69. .addComponent(etStatus, javax.swing.GroupLayout.PREFERRED_SIZE, 132, javax.swing.GroupLayout.PREFERRED_SIZE)
  70. .addContainerGap(83, Short.MAX_VALUE))
  71. .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
  72. .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  73. .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
  74. .addContainerGap()
  75. .addComponent(etPass))
  76. .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
  77. .addContainerGap()
  78. .addComponent(etUser)))
  79. .addContainerGap())
  80. );
  81. layout.setVerticalGroup(
  82. layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  83. .addGroup(layout.createSequentialGroup()
  84. .addComponent(etUser, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  85. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  86. .addComponent(etPass, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  87. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
  88. .addComponent(bInregistrare)
  89. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 47, Short.MAX_VALUE)
  90. .addComponent(etStatus)
  91. .addContainerGap())
  92. );
  93.  
  94. pack();
  95. }// </editor-fold>
  96.  
  97. private void etUserActionPerformed(java.awt.event.ActionEvent evt) {
  98. // TODO add your handling code here:
  99. }
  100.  
  101. private void etPassActionPerformed(java.awt.event.ActionEvent evt) {
  102. // TODO add your handling code here:
  103. }
  104.  
  105. private void bInregistrareActionPerformed(java.awt.event.ActionEvent evt) {
  106. // TODO add your handling code here:
  107. String user=etUser.getText();
  108. String pass=etPass.getText();
  109. String nume="laur";
  110. String parola="123";
  111.  
  112. {
  113. if(user=pass)
  114. etStatus.setText("Conectare Reusita!!");
  115. else
  116. etStatus.setText("Conectare esuata!!!");
  117. }
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125. }
  126.  
  127. /**
  128. * @param args the command line arguments
  129. */
  130. public static void main(String args[]) {
  131. /* Set the Nimbus look and feel */
  132. //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
  133. /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
  134. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
  135. */
  136. try {
  137. for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
  138. if ("Nimbus".equals(info.getName())) {
  139. javax.swing.UIManager.setLookAndFeel(info.getClassName());
  140. break;
  141. }
  142. }
  143. } catch (ClassNotFoundException ex) {
  144. java.util.logging.Logger.getLogger(Verificare.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  145. } catch (InstantiationException ex) {
  146. java.util.logging.Logger.getLogger(Verificare.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  147. } catch (IllegalAccessException ex) {
  148. java.util.logging.Logger.getLogger(Verificare.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  149. } catch (javax.swing.UnsupportedLookAndFeelException ex) {
  150. java.util.logging.Logger.getLogger(Verificare.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  151. }
  152. //</editor-fold>
  153.  
  154. /* Create and display the form */
  155. java.awt.EventQueue.invokeLater(new Runnable() {
  156. public void run() {
  157. new Verificare().setVisible(true);
  158. }
  159. });
  160. }
  161.  
  162. // Variables declaration - do not modify
  163. private javax.swing.JToggleButton bInregistrare;
  164. private javax.swing.JTextField etPass;
  165. private javax.swing.JLabel etStatus;
  166. private javax.swing.JTextField etUser;
  167. // End of variables declaration
  168. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement