Advertisement
Guest User

coding

a guest
Apr 22nd, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. private void setupListenersForValidation() {
  2. this.phoneNumberTextField.textProperty().addListener((observable, oldValue, newValue) -> {
  3. if (newValue != null) {
  4. if (!newValue.matches("\\(\\d{3}\\)\\d{3}-?\\d{4}")) {
  5. ContactGuiCodeBehind.this.phoneNumberTextField.setText(oldValue);
  6. ContactGuiCodeBehind.this.idErrorLabel.setVisible(true);
  7. } else {
  8. ContactGuiCodeBehind.this.idErrorLabel.setVisible(false);
  9. }
  10. }
  11. });
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement