Looping depending on a comand

I want my program to restart agian as long as the user clicks yes in the JOpition box and if they click NO i want it to close the program. I think i should use a while loop but dont know hoe. Can any one help:

void program()

{

int total= displayFirst()+displaySecond()+displayThree();

JOptionPane.showMessageDialog(null,"The total score for all three rounds is"+ total);

}

public static void main(String[] args)

{

diceGame game = new diceGame();

int peter=JOptionPane.showConfirmDialog(null,"Do you wish to play agian?","Dice Game", JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE);

if(peter==JOptionPane.YES_OPTION)

{

game.program();

}

else if(peter==JOptionPane.NO_OPTION)

{

System.out.println("" );

}

[819 byte] By [xbox200a] at [2007-10-2 7:57:11]
# 1
do{game.program();}while(JOptionPane.showConfirmDialog(...) == JOptionPane.YES_OPTION);
itchyscratchya at 2007-7-16 21:47:33 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 2
Thank you very much i thought it would be do while but couldn't work out how implement it.Hope you have a mery christmas know i've got it working i will to.lol
xbox200a at 2007-7-16 21:47:33 > top of Java-index,Java HotSpot Virtual Machine,Specifications...