Is there any way to accept only numeric values in a JTextField? Is there any special method for this?
JTextField
Also, consider using an InputVerifier.