Advertisement
Guest User

Untitled

a guest
May 28th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. tf[i][j].textProperty().addListener((ObservableValue<? extends String> observable, String oldValue, String newValue) -> {
  2. if (!newValue.matches("[1-9]*")) {
  3. ((StringProperty) observable).set(oldValue);
  4.  
  5. } else if (newValue.matches("[1-9]*")) {
  6. if (newValue.length() > 1) {
  7. ((StringProperty) observable).set(newValue.substring(newValue.length() - 1));
  8. }
  9. }
  10. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement