Method 1
Try something like this:
try {
do {
...
if (condition)
break;
...
} while(false);
} catch () {
...
}
So the try block is just a do-while loop consisting all of the code. If the condition is true, it breaks out of the loop, and hence the try block.
Otherwise, it continues to the end and, because the condition of the do-while is false, comes out of the try block.
Note: If the if-statement is within another loop(other than this do-while loop), label this do-while loop, and later break to this label if condition is true.
Method 2
Make a custom Exception class and throw it only when the condition is met. Later, make the first catch statement to catch that custom exception. Like this:
try {
...
if (condition)
throw new CustomException();
...
} catch (CustomException e) {
// Condition was true
} catch () {
...
}