Java javax.swing JPasswordField fields, constructors, methods, implement or subclass

Example usage for Java javax.swing JPasswordField fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for javax.swing JPasswordField.

The text is from its open source code.

Subclass

javax.swing.JPasswordField has subclasses.
Click this link to see all its subclasses.

Constructor

JPasswordField()
Constructs a new JPasswordField, with a default document, null starting text string, and 0 column width.
JPasswordField(String text)
Constructs a new JPasswordField initialized with the specified text.
JPasswordField(int columns)
Constructs a new empty JPasswordField with the specified number of columns.
JPasswordField(String text, int columns)
Constructs a new JPasswordField initialized with the specified text and columns.
JPasswordField(Document doc, String txt, int columns)
Constructs a new JPasswordField that uses the given text storage model and the given number of columns.

Method

voidaddActionListener(ActionListener l)
Adds the specified action listener to receive action events from this textfield.
voidaddAncestorListener(AncestorListener listener)
Registers listener so that it will receive AncestorEvents when it or any of its ancestors move or are made visible or invisible.
voidaddCaretListener(CaretListener listener)
Adds a caret listener for notification of any changes to the caret.
voidaddKeyListener(KeyListener l)
Adds the specified key listener to receive key events from this component.
voidcopy()
Invokes provideErrorFeedback on the current look and feel, which typically initiates an error beep.
voidcut()
Invokes provideErrorFeedback on the current look and feel, which typically initiates an error beep.
booleanechoCharIsSet()
Returns true if this JPasswordField has a character set for echoing.
AccessibleContextgetAccessibleContext()
Returns the AccessibleContext associated with this JPasswordField.
BordergetBorder()
Returns the border of this component or null if no border is currently set.
DocumentgetDocument()
Fetches the model associated with the editor.
chargetEchoChar()
Returns the character to be used for echoing.
char[]getPassword()
Returns the text contained in this TextComponent.
DimensiongetPreferredSize()
Returns the preferred size Dimensions needed for this TextField.
StringgetText()
Returns the text contained in this TextComponent.
voidpaste()
Transfers the contents of the system clipboard into the associated text model.
voidrequestFocus()
Requests that this Component gets the input focus.
booleanrequestFocusInWindow()
Requests that this Component gets the input focus.
voidselectAll()
Selects all the text in the TextComponent.
voidsetActionCommand(String command)
Sets the command string used for action events.
voidsetBounds(int x, int y, int width, int height)
Moves and resizes this component.
voidsetColumns(int columns)
Sets the number of columns in this TextField, and then invalidate the layout.
voidsetEchoChar(char c)
Sets the echo character for this JPasswordField.
voidsetEditable(boolean b)
Sets the specified boolean to indicate whether or not this TextComponent should be editable.
voidsetFont(Font f)
Sets the current font.
voidsetInputVerifier(InputVerifier inputVerifier)
Sets the input verifier for this component.
voidsetMinimumSize(Dimension minimumSize)
Sets the minimum size of this component to a constant value.
voidsetPreferredSize(Dimension preferredSize)
Sets the preferred size of this component.
voidsetText(String t)
Sets the text of this TextComponent to the specified text.
voidsetToolTipText(String text)
Registers the text to display in a tool tip.