How to allow only digits (without any limit in number of digits) in a JFormattedTextField
? I mean I don't want to check to see what has been entered in my JFormattedTextField
, itself doesn't allow any input except digits.
Asked
Active
Viewed 135 times
0
-
any input???, without decimal separator and negative sing ??? or not – mKorbel Jan 21 '13 at 16:22
-
only digits from 0 to 9 and nothing else ! – Soheil Jan 21 '13 at 16:24
-
2have look at DocumentFilter with Pattern, nothing else ! – mKorbel Jan 21 '13 at 16:38
-
I don't know how to use it... – Soheil Jan 21 '13 at 17:54
-
1you can to use this [DocumentFilter](http://stackoverflow.com/a/9779203/714968), could be valid for all kinds o [JTextComponents](http://docs.oracle.com/javase/tutorial/uiswing/components/text.html) – mKorbel Jan 21 '13 at 18:45