Java JPasswordfield Class Example

JPASSWORDFIELD

Java Swing Tutorial Explaining the JPasswordField Component. JPasswordField (a direct subclass of JTextField) you can suppress the display of input. Each character entered can be replaced by an echo character. This allows confidential input for passwords, for example. By default, the echo character is the asterisk, *. When the user types data into them and presses the Enter key, an action event occurs. If the program registers an event listener, the listener processes the event and can use the data in the text field at the time of the event in the program. If you need to provide an editable text field that doesn’t show the characters the user types – use the JPasswordField class.