|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object![]()
![]()
![]()
java.awt.Component
![]()
![]()
![]()
java.awt.Container
![]()
![]()
![]()
javax.swing.JComponent
![]()
![]()
![]()
javax.swing.text.JTextComponent
![]()
![]()
![]()
javax.swing.JTextField
![]()
![]()
![]()
javax.swing.JPasswordField
, MenuContainer
, Serializable
, Accessible
, Scrollable
, SwingConstants

public class JPasswordField

JPasswordField is a lightweight component that allows
the editing of a single line of text where the view indicates
something was typed, but does not show the original characters.
You can find further information and examples in
How to Use Text Fields,
a section in The Java Tutorial.
JPasswordField is intended
to be source-compatible with java.awt.TextField
used with echoChar set. It is provided separately
to make it easier to safely change the UI for the
JTextField without affecting password entries.
Warning:
Serialized objects of this class will not be compatible with
future Swing releases. The current serialization support is
appropriate for short term storage or RMI between applications running
the same version of Swing. As of 1.4, support for long term storage
of all JavaBeansTM
has been added to the java.beans package.
Please see XMLEncoder
.
| Nested Class Summary | |
|---|---|
protected class |
JPasswordField.AccessibleJPasswordField
This class implements accessibility support for the JPasswordField class. |
Nested classes/interfaces inherited from class javax.swing.JTextField ![]() |
|---|
JTextField.AccessibleJTextField |
Nested classes/interfaces inherited from class javax.swing.text.JTextComponent ![]() |
|---|
JTextComponent.AccessibleJTextComponent |
Nested classes/interfaces inherited from class javax.swing.JComponent ![]() |
|---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container ![]() |
|---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component ![]() |
|---|
Component.AccessibleAWTComponent |
| Field Summary |
|---|
Fields inherited from class javax.swing.JTextField ![]() |
|---|
notifyAction |
Fields inherited from class javax.swing.text.JTextComponent ![]() |
|---|
DEFAULT_KEYMAP |
Fields inherited from class javax.swing.JComponent ![]() |
|---|
accessibleContext |
Fields inherited from class java.awt.Component ![]() |
|---|
BOTTOM_ALIGNMENT |
Fields inherited from interface javax.swing.SwingConstants ![]() |
|---|
BOTTOM |
Fields inherited from interface java.awt.image.ImageObserver ![]() |
|---|
ABORT |
| Constructor Summary | |
|---|---|
JPasswordField
Constructs a new JPasswordField,
with a default document, null starting
text string, and 0 column width. |
|
JPasswordField
Constructs a new JPasswordField that uses the
given text storage model and the given number of columns. |
|
JPasswordField
Constructs a new empty JPasswordField with the specified
number of columns. |
|
JPasswordField
Constructs a new JPasswordField initialized
with the specified text. |
|
JPasswordField
Constructs a new JPasswordField initialized with
the specified text and columns. |
|
| Method Summary | |
|---|---|
void |
copy
Invokes provideErrorFeedback on the current
look and feel, which typically initiates an error beep. |
void |
cut
Invokes provideErrorFeedback on the current
look and feel, which typically initiates an error beep. |
boolean |
echoCharIsSet
Returns true if this JPasswordField has a character
set for echoing. |
AccessibleContext |
getAccessibleContext
Returns the AccessibleContext associated with this
JPasswordField. |
char |
getEchoChar
Returns the character to be used for echoing. |
char[] |
getPassword
Returns the text contained in this TextComponent. |
String |
getText
Deprecated. As of Java 2 platform v1.2, replaced by getPassword. |
String |
getText
Deprecated. As of Java 2 platform v1.2, replaced by getPassword. |
String |
getUIClassID
Returns the name of the L&F class that renders this component. |
protected String |
paramString
Returns a string representation of this JPasswordField. |
void |
setEchoChar
Sets the echo character for this JPasswordField. |
Methods inherited from class javax.swing.JTextField ![]() |
|---|
addActionListener |
Methods inherited from class javax.swing.text.JTextComponent ![]() |
|---|
addCaretListener |