I've got a JTextField
. Is there any way I can restrict it to only allow the user to insert numbers in to it?
Currently I've got a button connected to the Text Field so when its pressed it does getText()
and converts it to a int
, obviously this becomes a problem if the user does not submit an int
in the first place.