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.
-
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.
-
echoCharIsSet()
- Returns true if this JPasswordField has a character set for
echoing.
-
getEchoChar()
- Returns the character to be used for echoing.
-
getUIClassID()
-
-
setEchoChar(char)
- Sets the echo character for this JPasswordField.
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.
getUIClassID
public String getUIClassID()
- 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
All Packages Class Hierarchy This Package Previous Next Index