The class "TextIO" you're using isn't part of the standard Java API; maybe an instructor gave it to you, or you got it from a book. You're assuming that the "getInt()" method is going to throw a NumberFormatException. That's a reasonable assumption, but perhaps it doesn't. For example, here is the first Google hit for a class by this name, and it, sadly, prints an error message instead of throwing an exception, and returns zero! This is a horrifyingly bad design; please, please don't learn from this as an example!
Try just using the java.util.Scanner class directly -- it'll behave the way you want, plus you'll be writing real code.