Is there any way to accept only numeric values in a JTextField? Is there any special method for this?
JTextField
Although there is the pure evil JFormattedTextField there isn't a trivial way to do it using only the Swing library. The best way to implement this sort of feature is with a DocumentFilter.
JFormattedTextField
DocumentFilter
Some code I prepared earlier. A bit of description.