1 19 20 package org.netbeans.modules.j2ee.oc4j.util; 21 22 26 public class OC4JPasswordInputPanel extends javax.swing.JPanel { 27 28 private String user; 29 30 31 public OC4JPasswordInputPanel(String user) { 32 this.user = user; 33 34 initComponents(); 35 jPasswordField1.setText(""); 36 jPasswordField1.requestFocus(); 37 38 javax.swing.KeyStroke enter = javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_ENTER, 0); 39 javax.swing.text.Keymap map = jPasswordField1.getKeymap(); 40 41 map.removeKeyStrokeBinding(enter); 42 } 43 47 public String getPassword() { 48 return String.valueOf(jPasswordField1.getPassword()); 49 } 50 55 private void initComponents() { 57 java.awt.GridBagConstraints gridBagConstraints; 58 59 jTextArea1 = new javax.swing.JTextArea (); 60 jLabel1 = new javax.swing.JLabel (); 61 jPasswordField1 = new javax.swing.JPasswordField (); 62 jLabel2 = new javax.swing.JLabel (); 63 64 jTextArea1.setBackground(new java.awt.Color (192, 192, 192)); 65 jTextArea1.setEditable(false); 66 jTextArea1.setLineWrap(true); 67 jTextArea1.setText(org.openide.util.NbBundle.getMessage(OC4JPasswordInputPanel.class, "LBL_PasswordLongtext", new Object [] {user})); jTextArea1.setWrapStyleWord(true); 69 jTextArea1.setFocusable(false); 70 jTextArea1.setOpaque(false); 71 72 jLabel1.setLabelFor(jPasswordField1); 73 java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/oc4j/util/Bundle"); org.openide.awt.Mnemonics.setLocalizedText(jLabel1, bundle.getString("LBL_PasswordText")); 76 org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); 77 this.setLayout(layout); 78 layout.setHorizontalGroup( 79 layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 80 .add(layout.createSequentialGroup() 81 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 82 .add(jLabel2) 83 .add(layout.createSequentialGroup() 84 .addContainerGap() 85 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false) 86 .add(org.jdesktop.layout.GroupLayout.LEADING, jTextArea1) 87 .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() 88 .add(jLabel1) 89 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 90 .add(jPasswordField1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 207, Short.MAX_VALUE))))) 91 .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 92 ); 93 layout.setVerticalGroup( 94 layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 95 .add(layout.createSequentialGroup() 96 .add(jLabel2) 97 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 98 .add(jTextArea1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 30, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) 99 .add(14, 14, 14) 100 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) 101 .add(jLabel1) 102 .add(jPasswordField1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) 103 .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 104 ); 105 106 jTextArea1.getAccessibleContext().setAccessibleDescription(null); 107 jLabel1.getAccessibleContext().setAccessibleDescription(null); 108 jPasswordField1.getAccessibleContext().setAccessibleName("password"); 109 } 111 112 public javax.swing.JLabel jLabel1; 114 public javax.swing.JLabel jLabel2; 115 public javax.swing.JPasswordField jPasswordField1; 116 public javax.swing.JTextArea jTextArea1; 117 119 } 120 | Popular Tags |