You can use any of the JOptionPane's option constants, you just need to supply a options array of size 4:
public static void main(String[] args) {
String[] options = new String[] {"Yes", "No", "Maybe", "Cancel"};
int response = JOptionPane.showOptionDialog(null, "Message", "Title",
JOptionPane.DEFAULT_OPTION, JOptionPane.PLAIN_MESSAGE,
null, options, options[0]);
// Where response == 0 for Yes, 1 for No, 2 for Maybe and -1 or 3 for Escape/Cancel.
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…