Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tf[i][j].textProperty().addListener((ObservableValue<? extends String> observable, String oldValue, String newValue) -> {
- if (!newValue.matches("[1-9]*")) {
- ((StringProperty) observable).set(oldValue);
- } else if (newValue.matches("[1-9]*")) {
- if (newValue.length() > 1) {
- ((StringProperty) observable).set(newValue.substring(newValue.length() - 1));
- }
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement