Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void setupListenersForValidation() {
- this.phoneNumberTextField.textProperty().addListener((observable, oldValue, newValue) -> {
- if (newValue != null) {
- if (!newValue.matches("\\(\\d{3}\\)\\d{3}-?\\d{4}")) {
- ContactGuiCodeBehind.this.phoneNumberTextField.setText(oldValue);
- ContactGuiCodeBehind.this.idErrorLabel.setVisible(true);
- } else {
- ContactGuiCodeBehind.this.idErrorLabel.setVisible(false);
- }
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement