I am trying to create a message with a Yes or No button. Then a window will appear with a certain message that depends on if the user clicked Yes or No.
Here is m
Code for Yes and No Message
int n = JOptionPane.showConfirmDialog( null, "sample question?!" , "", JOptionPane.YES_NO_OPTION); if(n == JOptionPane.YES_OPTION) { JOptionPane.showMessageDialog(null, "Opening..."); } else { JOptionPane.showMessageDialog(null, "Goodbye"); System.exit(0);