The best way I know to solve that is (modifications are marked with
a '*':
> public void MyInt(){
*boolean continue = true; //Control variable
*while(continue){ //evaluate
> try{
> int1 = Integer.parseInt(JOptionPane.showInputDialog("type the
1
> number"));
> int2 = Integer.parseInt(JOptionPane.showInputDialog("type the
2
> number"));
> int3 = Integer.parseInt(JOptionPane.showInputDialog("type the
3
> number"));
> y = "";}
* continue = false; //if no problem was detected
> catch(java.lang.NumberFormatException x){
* continue = true; //if a problem was detected, making possible
* another cicle
> JOptionPane.showMessageDialog(null, "you have to make an
entry");}
> }