+ 1
Help pls.. How do you make it so when click then close button (x), it will prompt again until you click the Yes button?
int answer = JOptionPane.showConfirmDialog( null, message, title, JOptionPane.YES_NO_OPTION); if ( answer == JOption.YES_OPTION) { JOptionPane.ShowMessageDialog(null, "null, msg, title, JOptionPane.YES_OPTION); } else if ( answer == JOption.NO_OPTION) { JOptionPane.ShowMessageDialog(null, "null, msg, title, JOptionPane.NO_OPTION); } else JOptionPane.ShowMessageDialog(null, msg, title, JOptionPane..CLOSE_OPTION); }}
4 Antworten
0
put ur code in a while loop not if.
copy ur code in playground and send it's link if u need more help
+ 12
variable answer can have two values either 0 or 1 , so why not in if() statement ... comparision be done with either 0 or 1
+ 1
thanks guys! I finish it now. :)
0
👍