📜  joptionpane.showconfirmdialog 是 否 示例 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:27.145000             🧑  作者: Mango

代码示例1
int answer = JOptionPane.showConfirmDialog(parentComponent, 
        "Your message goes here", "Your title goes here", 
        JOptionPane.YES_NO_OPTION);

if (answer == JOptionPane.NO_OPTION) {
    // do something
} else if(answer == JOptionPane.YES_OPTION) {
      // do something else
}