I can't believe I haven't been able to find anything on this. It has to be a very common use-case.
I want to set my TextField (JavaFX) up so that the user is limited to entering data by pattern. For example, a standard US telephone number with a pattern like (###) ###-####. I have no problem formatting after the fact, and I see lots of tutorials/examples on restricting input to just numbers and the "(", ")", and "-" in the right places, but I don't want the user to have to enter the parentheses and dash - they should just be there and the numbers should get entered "around" them.
I see this all the time on web pages - so javascript must do it easily. I used to work in a language where it was as easy as something like:
myTextField.setInputPattern("(999) 999-9999") // yes this is fictional code You could do the same thing with any pattern - ss#, date entry, ip addresses, etc. and I'm a little stunned that I haven't been able to find something in JavaFX for this.