Это работает для меня
String[] choices = { "Option 1", "Option 2", "Option 3", "Option 4" };
int response = JOptionPane.showOptionDialog(null, "Dialog text",
"Title", JOptionPane.YES_NO_OPTION, JOptionPane.PLAIN_MESSAGE,
null, choices, null);
System.out.println(response);
Возвращает 0-3
(выбранный вариант) или -1
, если вы отмените диалог.