The best way to handle this is not to use a try/catch block, but to
get the text from the JoptionPane and determine if it is null BEFORE
you parse the int... Otherwise you will have to put a try/catch on
each call.
You could also create an array of int[] and loop through the
for(int i=0; i<numberOfIntegers; i++){
try{
int[i] = Integer.parseInt(JOptionPane.showInputDialog("type the
number"));
}
catch(NumberFormatException e){
JOptionPane.showMessageDialog(null, "you have to make an entry");}
i = i-1;
}
}
You could have an array of Strings which would give you a different
message for each loop... etc etc...
That way, you don't have to have 1000's of try/catches, and you
ALWAYS know which input failed.