View Single Post
  #1 (permalink)  
Old 12-08-2007, 07:37 AM
mandrake446 mandrake446 is offline
Member
 
Join Date: Nov 2007
Posts: 8
mandrake446 is on a distinguished road
Yes/No confirm dialog box
I was just wondering how to creat a "yes / no" dialog box. I can create a dialog boxes with the choice for "ok/ 'x' in the corner" its just

import javax.swing.JOptionPane; //before the class declaration

JOptionPane.showMessageDialog(null, "Are you an idiot?"); //in the class



i was just wondering if someone could show me the code for a "yes/no" option dialog box.

Thanks,
Mandrake




edit: What i'm trying to do is use a yes/no dialog box as the control for a loop where if "yes" is selected the loop will run though again, but terminates if "no" is selected.

example:

Do you want more money?

Yes: (loop causes your taxes to raise)
yes: (loop causes your taxes to raise)
yes: (loop causes your taxes to raise)

No:(loop terminates, not raising your taxes)

Last edited by mandrake446 : 12-08-2007 at 07:55 AM.
Reply With Quote
Sponsored Links