All Packages  Class Hierarchy  This Package  Previous  Next  Index

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.


Constructor Index

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

Method Index

 o echoCharIsSet()
Returns true if this JPasswordField has a character set for echoing.
 o getEchoChar()
Returns the character to be used for echoing.
 o getUIClassID()
 o setEchoChar(char)
Sets the echo character for this JPasswordField.

Constructors

 o JPasswordField
 public JPasswordField()
Constructs a new JPasswordField.

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

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

Parameters:
columns - the number of columns
 o 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
 o 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

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

Returns:
the echo character
See Also:
setEchoChar, echoCharIsSet
 o 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
 o 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

All Packages  Class Hierarchy  This Package  Previous  Next  Index