I have created a form using JFormDesigner and need to add a 1000 seperator automatically when the user types a number of 4 digits or more.I have tried the following code but it does not add the seperator(,) real time.
int no=Integer.parseInt(textField1.getText());
String str = String.format("%,d", no);
textField1.setText(str);
Any help would be appreciated.