JOptionPane's static method showConfirmDialog returns int value and has following options:

- DEFAULT_OPTION
- YES_NO_OPTION
- YES_NO_CANCEL_OPTION
- OK_CANCEL_OPTION

Java Code:
int jInput;
jInput = JOptionPane.showConfirmDialog(null,"YES_NO_OPTION",
   "YES_NO_OPTION", JOptionPane.YES_NO_OPTION);
jInput = JOptionPane.showConfirmDialog(null,"CANCEL_OPTION",
   "CANCEL_OPTION", JOptionPane.CANCEL_OPTION);
jInput = JOptionPane.showConfirmDialog(null,"NO_OPTION", "NO_OPTION",
   JOptionPane.NO_OPTION);
jInput = JOptionPane.showConfirmDialog(null,"OK_OPTION", "OK_OPTION",
   JOptionPane.OK_OPTION);
jInput = JOptionPane.showConfirmDialog(null,"CLOSED_OPTION",
   "CLOSED_OPTION", JOptionPane.CLOSED_OPTION);