Class PasswordField

All Implemented Interfaces:
Styleable, EventTarget, Skinnable

public class PasswordField
extends TextField
Text field that masks entered characters.

Example:

 var passwordField = new PasswordField();
 passwordField.setText("password123");
Image of the PasswordField control
Since:
JavaFX 2.0
  • Constructor Details

    • PasswordField

      public PasswordField()
      Creates a default PasswordField instance.
  • Method Details

    • cut

      public void cut()
      Does nothing for PasswordField.
      Overrides:
      cut in class TextInputControl
    • copy

      public void copy()
      Does nothing for PasswordField.
      Overrides:
      copy in class TextInputControl
    • queryAccessibleAttribute

      public Object queryAccessibleAttribute​(AccessibleAttribute attribute, Object... parameters)
      This method is called by the assistive technology to request the value for an attribute.

      This method is commonly overridden by subclasses to implement attributes that are required for a specific role.
      If a particular attribute is not handled, the superclass implementation must be called.

      Overrides:
      queryAccessibleAttribute in class TextInputControl
      Parameters:
      attribute - the requested attribute
      parameters - optional list of parameters
      Returns:
      the value for the requested attribute
      See Also:
      AccessibleAttribute