Class PasswordTextFormatter

java.lang.Object
javafx.scene.control.TextFormatter<String>
atlantafx.base.util.PasswordTextFormatter

public class PasswordTextFormatter extends javafx.scene.control.TextFormatter<String>
An alternative to the PasswordField class. This formatter masks or unmasks text field content based on a boolean property.
  • Property Details

  • Field Details

  • Constructor Details

    • PasswordTextFormatter

      protected PasswordTextFormatter(javafx.util.StringConverter<String> valueConverter, UnaryOperator<javafx.scene.control.TextFormatter.Change> filter, javafx.scene.control.TextField field, char bullet)
  • Method Details

    • passwordProperty

      public javafx.beans.property.ReadOnlyStringProperty passwordProperty()
      Always returns the unmasked password text regardless of the revealPasswordProperty() state.
      Returns:
      the password property
      See Also:
    • getPassword

      public String getPassword()
    • revealPasswordProperty

      public javafx.beans.property.BooleanProperty revealPasswordProperty()
      Specifies whether the unmasked password text is revealed or not.
      Returns:
      the revealPassword property
      See Also:
    • getRevealPassword

      public boolean getRevealPassword()
    • setRevealPassword

      public void setRevealPassword(boolean reveal)
    • create

      public static PasswordTextFormatter create(javafx.scene.control.TextField field, char bullet)
      Creates a new password text formatter with the provided mask character and applies itself to the specified text field.
    • create

      public static PasswordTextFormatter create(javafx.scene.control.TextField textField)
      Creates a new password text formatter with the default mask character and applies itself to the specified text field.