i usually use String::matches(String) .. it takes a regular expression as a string.. if you put it in your action handler then you can sort through input before you need an exception handled..
here is an example with a text box..
ex
Code:
if(textArea.getText().matches("[0-9]+"))
System.out.println("good input");
else System.out.println("BAD input");