The TextFormatter Class in JavaFX: How to Restrict User Input in a Text Field

Posted on Tue 05 April 2016 in JavaFX • Tagged with change listener, event, JavaFX, Richard Bair, text field, text formatter

There are a lot of code examples for restricting or modifying user input into a JavaFX text field. Most examples I have seen suggest adding a change listener to the text field's text property. Here's how you would allow only lower-case characters in your text field using the change listener …


Continue reading