I am planning to make a maths game there will be one question like 1+ 1 as an image in Javafx. The textbox provided will give the user to input the number how do for example for 1+1 just allow the user to put in 2 and for everything else it will not accept then number in the text box. and display a message try again or something similar.
Basicly how do I restrict the text box for a specific number