KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > sun > ide > j2ee > ui > MasterPasswordInputPanel


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.j2ee.sun.ide.j2ee.ui;
21
22 /**
23  *
24  * @author ludo
25  */

26 public class MasterPasswordInputPanel extends javax.swing.JPanel JavaDoc {
27
28     /** Creates new form NewJPanel */
29     public MasterPasswordInputPanel() {
30         initComponents();
31         jPasswordField1.setText("");
32         jPasswordField1.requestFocus();
33
34         javax.swing.KeyStroke JavaDoc enter = javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_ENTER, 0);
35         javax.swing.text.Keymap JavaDoc map = jPasswordField1.getKeymap();
36
37         map.removeKeyStrokeBinding(enter);
38     }
39     /**
40      * Get the text which the user typed into the input line.
41      * @return the text entered by the user
42      */

43     public String JavaDoc getMasterPassword() {
44         return String.valueOf(jPasswordField1.getPassword());
45     }
46     /** This method is called from within the constructor to
47      * initialize the form.
48      * WARNING: Do NOT modify this code. The content of this method is
49      * always regenerated by the Form Editor.
50      */

51     // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
52
private void initComponents() {
53         java.awt.GridBagConstraints JavaDoc gridBagConstraints;
54
55         jTextArea1 = new javax.swing.JTextArea JavaDoc();
56         jLabel1 = new javax.swing.JLabel JavaDoc();
57         jPasswordField1 = new javax.swing.JPasswordField JavaDoc();
58         jLabel2 = new javax.swing.JLabel JavaDoc();
59
60         setMinimumSize(new java.awt.Dimension JavaDoc(310, 157));
61         setPreferredSize(new java.awt.Dimension JavaDoc(310, 157));
62         setLayout(new java.awt.GridBagLayout JavaDoc());
63
64         jTextArea1.setBackground(java.awt.Color.lightGray);
65         jTextArea1.setEditable(false);
66         jTextArea1.setLineWrap(true);
67         java.util.ResourceBundle JavaDoc bundle = java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/ide/j2ee/ui/Bundle"); // NOI18N
68
jTextArea1.setText(bundle.getString("MasterPasswordInputDialog_longtext")); // NOI18N
69
jTextArea1.setWrapStyleWord(true);
70         jTextArea1.setFocusable(false);
71         jTextArea1.setOpaque(false);
72         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
73         gridBagConstraints.gridwidth = 3;
74         gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
75         gridBagConstraints.weightx = 1.0;
76         gridBagConstraints.insets = new java.awt.Insets JavaDoc(12, 12, 5, 12);
77         add(jTextArea1, gridBagConstraints);
78         jTextArea1.getAccessibleContext().setAccessibleDescription(bundle.getString("MasterPasswordInputDialog_longtext")); // NOI18N
79

80         jLabel1.setLabelFor(jPasswordField1);
81         org.openide.awt.Mnemonics.setLocalizedText(jLabel1, bundle.getString("MasterPasswordInputDialog_text")); // NOI18N
82
gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
83         gridBagConstraints.gridx = 0;
84         gridBagConstraints.gridy = 1;
85         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
86         gridBagConstraints.insets = new java.awt.Insets JavaDoc(6, 12, 6, 6);
87         add(jLabel1, gridBagConstraints);
88         jLabel1.getAccessibleContext().setAccessibleDescription(bundle.getString("MasterPasswordInputDialog_text")); // NOI18N
89

90         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
91         gridBagConstraints.gridx = 1;
92         gridBagConstraints.gridy = 1;
93         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
94         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
95         gridBagConstraints.insets = new java.awt.Insets JavaDoc(6, 6, 6, 12);
96         add(jPasswordField1, gridBagConstraints);
97         jPasswordField1.getAccessibleContext().setAccessibleName("password");
98
99         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
100         gridBagConstraints.gridx = 0;
101         gridBagConstraints.gridy = 2;
102         gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL;
103         gridBagConstraints.weighty = 1.0;
104         add(jLabel2, gridBagConstraints);
105     }// </editor-fold>//GEN-END:initComponents
106

107     
108     // Variables declaration - do not modify//GEN-BEGIN:variables
109
public javax.swing.JLabel JavaDoc jLabel1;
110     public javax.swing.JLabel JavaDoc jLabel2;
111     public javax.swing.JPasswordField JavaDoc jPasswordField1;
112     public javax.swing.JTextArea JavaDoc jTextArea1;
113     // End of variables declaration//GEN-END:variables
114

115 }
116
Popular Tags