Ironically, and IIRC btw, you can use a break. Java doesnt let young programmers use Goto becase gotos are evil and bad programming, but if you need to break out of a larger loop based on something inside of a smaller loop... you can do this:
outer:
for (int i = 0; i < I_MAX; i++) {
for (int j = 0; i < J_MAX; j++){
// bla bla bla error checking or something
break outer; //Will break out of the loop designated by outer.
}
}
Now i'm not a java coder at all; hate the fucking stuff. But if i was a java coder and you wanted exactly what you said in your post I'd say use something like this;
Boolean isGood = true;
outer:
for (int i = 0; i < I_MAX; i++) {
for (int j = 0; i < J_MAX; j++){
// bla bla bla error checking or something
isGood = false;
break outer; //Will break out of the loop designated by outer.
}
}
if (isGood) {
doSomething();
} else {
doSomethingElse();
}
BUt like I said Im no Java coder and Im sure someone else will chime in