Search in sources :

Example 1 with PasswordValidator

use of io.bitsquare.gui.util.validation.PasswordValidator in project bitsquare by bitsquare.

the class WalletPasswordWindow method addInputFields.

private void addInputFields() {
    Label label = new Label("Enter password:");
    label.setWrapText(true);
    GridPane.setMargin(label, new Insets(3, 0, 0, 0));
    GridPane.setRowIndex(label, ++rowIndex);
    passwordTextField = new PasswordTextField();
    GridPane.setMargin(passwordTextField, new Insets(3, 0, 0, 0));
    GridPane.setRowIndex(passwordTextField, rowIndex);
    GridPane.setColumnIndex(passwordTextField, 1);
    PasswordValidator passwordValidator = new PasswordValidator();
    changeListener = (observable, oldValue, newValue) -> unlockButton.setDisable(!passwordValidator.validate(newValue).isValid);
    passwordTextField.textProperty().addListener(changeListener);
    gridPane.getChildren().addAll(label, passwordTextField);
}
Also used : Insets(javafx.geometry.Insets) PasswordValidator(io.bitsquare.gui.util.validation.PasswordValidator) PasswordTextField(io.bitsquare.gui.components.PasswordTextField)

Aggregations

PasswordTextField (io.bitsquare.gui.components.PasswordTextField)1 PasswordValidator (io.bitsquare.gui.util.validation.PasswordValidator)1 Insets (javafx.geometry.Insets)1