create a custom classes extending PlainDocument
public class NumericDocument extends PlainDocument
In this class override the insertString. Plenty of examples online which use the Character.isDigit method to check each inputted value to check if numeric or not.
The when your creating you JTextField do so using the
JTextField numericTextOnlyField = new JTextField(new NumericDocument())
inside the insertString method you can check to see of the values inserted are within the range you allow