Textfield that not accept any character except number [0-9] and its length also, in my case it is 11 but after adding {11} in regex expression that textfield doesn't accept any thing. Please help!
Code here:
public class NumberField extends JFXTextField {
@Override
public void replaceText(int i, int i1, String string){
if (string.matches("[0-9]{11}") || string.isEmpty()) //{11} is length of number
super.replaceText(i , i1 , string);
}