I\'m wondering how to do something only if Integer.parseInt(whatever) doesn\'t fail.
More specifically I have a jTextArea of user specified values seperated by line
You can use a scanner instead of try-catch:
Scanner scanner = new Scanner(line).useDelimiter("\n"); if(scanner.hasNextInt()){ System.out.println("yes, it's an int"); }