Limit TextField to a specific range of number JavaFX?
问题 Hi I need to limit the input of TextField javaFX not only for integer but also for numbers between 1 - 19 only.For example I should be allowed to type : "3" ,"19" ... but not: "33" , 44 .. for example : What is the recommended way to make a numeric TextField in JavaFX? but this limits the text field just for integers. 回答1: You can use regex to allow your specific numbers' range(1-19) and add that validation on TextField's TextFormatter's filter . Regex => ([1-9]|1[0-9]) [1-9] Either TextField