These responses show that there are always many ways of doing things in
Java, and choosing one method over another may be a matter of preference.
I ran a set of [very unscientific] tests and found that the four solutions, in order of performance, is:
1) Loop through string, calling "Character.isDigit()"
2) Pre-compiled Pattern,
3) String.match(...);
4) Integer.parseInt();
However the variance was no more than 2-2.5 seconds between best and worst when checking 1,000,000 numbers.
So using the "Integer.parseInt()" method and checking for an exception is acceptable. In the case where you not only want to
test if the String represents a number, but you also want to get the "int" value, this would probably be the best solution.
Looping through and checking for all digits was the fastest. But you don't get the value, and it isn't very extensible.
Using regular expressions won't give you the "int" value either, but it's faster than doing "Integer.parseInt()" [though the time savings is probably negligable]. However you do get some advantages. First, you learn a new Java API, and I think that learning new things is good. Second, it's very extensible, in that if you later need to check for a different pattern you can easily modify the code to handle it.
Let's say you need to check to see if something is a valid credit card number. You need to ensure it has exactly 16 digits, with optional spaces or hyphens between each set of four digits. You can forget doing the "Integer.parseInt()", or looping through. Now regular expressions come in real handy. You just have to decide if you want to pre-compile the pattern, or do a "Pattern.matches(...,...)" or "String.matches(...)" every time.
I realize that these comments are well beyond the scope of the original question, but I think it can be valuable to examine the strengths and weaknesses of each solution, and then apply the one that best fits the problem.