Advertisement
Susilo123

PasswordDialog.java

Feb 28th, 2020
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.94 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 steganografi;
  7.  
  8. import javax.swing.JButton;
  9. import javax.swing.JPasswordField;
  10.  
  11. /**
  12. *
  13. * @author Win10
  14. */
  15. public class PasswordDialog extends javax.swing.JFrame {
  16.  
  17. /**
  18. * Creates new form PasswordDialog
  19. */
  20. public PasswordDialog() {
  21.  
  22. initComponents();
  23. }
  24.  
  25. PasswordDialog(Menu_Utama aThis, boolean rootPaneCheckingEnabled) {
  26. throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
  27. }
  28.  
  29.  
  30. /**
  31. * This method is called from within the constructor to initialize the form.
  32. * WARNING: Do NOT modify this code. The content of this method is always
  33. * regenerated by the Form Editor.
  34. */
  35. @SuppressWarnings("unchecked")
  36. // <editor-fold defaultstate="collapsed" desc="Generated Code">
  37. private void initComponents() {
  38.  
  39. lblPass = new javax.swing.JLabel();
  40. txtPass = new javax.swing.JTextField();
  41. btnOK = new javax.swing.JButton();
  42. btnBatal = new javax.swing.JButton();
  43.  
  44. setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
  45.  
  46. lblPass.setText("Password");
  47.  
  48. btnOK.setText("Ok");
  49. btnOK.addActionListener(new java.awt.event.ActionListener() {
  50. public void actionPerformed(java.awt.event.ActionEvent evt) {
  51. btnOKActionPerformed(evt);
  52. }
  53. });
  54.  
  55. btnBatal.setText("Batal");
  56.  
  57. javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
  58. getContentPane().setLayout(layout);
  59. layout.setHorizontalGroup(
  60. layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  61. .addGroup(layout.createSequentialGroup()
  62. .addGap(65, 65, 65)
  63. .addComponent(lblPass)
  64. .addGap(18, 18, 18)
  65. .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  66. .addComponent(txtPass, javax.swing.GroupLayout.PREFERRED_SIZE, 175, javax.swing.GroupLayout.PREFERRED_SIZE)
  67. .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
  68. .addComponent(btnOK)
  69. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
  70. .addComponent(btnBatal)))
  71. .addContainerGap(66, Short.MAX_VALUE))
  72. );
  73. layout.setVerticalGroup(
  74. layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  75. .addGroup(layout.createSequentialGroup()
  76. .addGap(49, 49, 49)
  77. .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  78. .addComponent(lblPass)
  79. .addComponent(txtPass, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
  80. .addGap(18, 18, 18)
  81. .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  82. .addComponent(btnOK)
  83. .addComponent(btnBatal))
  84. .addContainerGap(55, Short.MAX_VALUE))
  85. );
  86.  
  87. pack();
  88. }// </editor-fold>
  89.  
  90.  
  91. public JPasswordField getPass(){
  92. return (JPasswordField) txtPass;
  93. }
  94.  
  95. public JButton getBtnSend(){
  96. return btnOK;
  97. }
  98.  
  99. public void bersihPass(){
  100. txtPass.setText(null);
  101. }
  102. private void btnOKActionPerformed(java.awt.event.ActionEvent evt) {
  103.  
  104. }
  105.  
  106. /**
  107. * @param args the command line arguments
  108. */
  109. public static void main(String args[]) {
  110. /* Set the Nimbus look and feel */
  111. //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
  112. /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
  113. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
  114. */
  115. try {
  116. for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
  117. if ("Nimbus".equals(info.getName())) {
  118. javax.swing.UIManager.setLookAndFeel(info.getClassName());
  119. break;
  120. }
  121. }
  122. } catch (ClassNotFoundException ex) {
  123. java.util.logging.Logger.getLogger(PasswordDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  124. } catch (InstantiationException ex) {
  125. java.util.logging.Logger.getLogger(PasswordDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  126. } catch (IllegalAccessException ex) {
  127. java.util.logging.Logger.getLogger(PasswordDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  128. } catch (javax.swing.UnsupportedLookAndFeelException ex) {
  129. java.util.logging.Logger.getLogger(PasswordDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  130. }
  131. //</editor-fold>
  132.  
  133. /* Create and display the form */
  134. java.awt.EventQueue.invokeLater(new Runnable() {
  135. public void run() {
  136. new PasswordDialog().setVisible(true);
  137. }
  138. });
  139. }
  140.  
  141. // Variables declaration - do not modify
  142. private javax.swing.JButton btnBatal;
  143. private javax.swing.JButton btnOK;
  144. private javax.swing.JLabel lblPass;
  145. private javax.swing.JTextField txtPass;
  146. // End of variables declaration
  147. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement