Where Am I? Class Hierarchy (JFC) All Classes (JFC)

Class com.sun.java.swing.JPasswordField

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----com.sun.java.swing.JComponent
                           |
                           +----com.sun.java.swing.text.JTextComponent
                                   |
                                   +----com.sun.java.swing.JTextField
                                           |
                                           +----com.sun.java.swing.JPasswordField

public class JPasswordField
extends JTextField

JTextField 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. It is intended to be source-compatible with java.awt.TextField used with echoChar set. It is provided seperately 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 Swing1.0 applications. It will not be possible to load serialized Swing1.0 objects with future releases of Swing. The JDK1.2 release of Swing will be the compatibility baseline for the serialized form of Swing objects.


Constructor Index

JPasswordField()
Constructs a new JPasswordField.
JPasswordField(Document, String, int)
Constructs a new JPasswordField that uses the given text storage model and the given number of columns.
JPasswordField(int)
Constructs a new empty JPasswordField with the specified number of columns.
JPasswordField(String)
Constructs a new JPasswordField initialized with the specified text.
JPasswordField(String, int)
Constructs a new JPasswordField initialized with the specified text and columns.

Method Index

echoCharIsSet()
Returns true if this JPasswordField has a character set for echoing.
getAccessibleContext()
Get the AccessibleContext associated with this JPasswordField
getEchoChar()
Returns the character to be used for echoing.
getUIClassID()
Returns the name of the L&F class that renders this component.
setEchoChar(char)
Sets the echo character for this JPasswordField.

Constructors

JPasswordField
 public JPasswordField()
Constructs a new JPasswordField.

JPasswordField
 public JPasswordField(String text)
Constructs a new JPasswordField initialized with the specified text.

Parameters:
text - the text to be displayed
JPasswordField
 public JPasswordField(int columns)
Constructs a new empty JPasswordField with the specified number of columns.

Parameters:
columns - the number of columns
JPasswordField
 public JPasswordField(String text,
                       int columns)
Constructs a new JPasswordField initialized with the specified text and columns.

Parameters:
text - the text to be displayed
columns - the number of columns
JPasswordField
 public JPasswordField(Document doc,
                       String txt,
                       int columns)
Constructs a new JPasswordField that uses the given text storage model and the given number of columns. This is the constructor through which the other constructors feed.

Parameters:
doc - the text storage to use
txt - the text to be displayed
columns - the number of columns to use to calculate the preferred width. If columns is set to zero, the preferred width will be whatever naturally results from the component implementation.

Methods

getUIClassID
 public String getUIClassID()
Returns the name of the L&F class that renders this component.

Returns:
"PasswordFieldUI"
Overrides:
getUIClassID in class JTextField
See Also:
getUIClassID, getUI
getEchoChar
 public char getEchoChar()
Returns the character to be used for echoing.

Returns:
the echo character
See Also:
setEchoChar, echoCharIsSet
setEchoChar
 public void setEchoChar(char c)
Sets the echo character for this JPasswordField. Note that this is largely a suggestion to the view as the view that gets installed can use whatever graphic techniques it desires to represent the field.

Parameters:
c - the echo character to display
See Also:
echoCharIsSet, getEchoChar
echoCharIsSet
 public boolean echoCharIsSet()
Returns true if this JPasswordField has a character set for echoing.

Returns:
true if a character is set for echoing
See Also:
setEchoChar, getEchoChar
getAccessibleContext
 public AccessibleContext getAccessibleContext()
Get the AccessibleContext associated with this JPasswordField

Returns:
the AccessibleContext of this JPasswordField
Overrides:
getAccessibleContext in class JTextField

Where Am I? Class Hierarchy (JFC) All Classes (JFC)