public static void integerTextField(TextField textField) {
        UnaryOperator<Change> integerFilter = change -> {
            String newText = change.getControlNewText();
            System.out.println("newText " + newText);
            if (newText.matches("-?([0-9]*)?")) {
                System.out.println("cumple regla");
                return change;
            }
            System.out.println("No cumple regla");
            return null;
        };
        textField.setTextFormatter(
                new TextFormatter<Integer>(
                        new IntegerStringConverter(), 0, integerFilter));
    }