想按取消按钮时什么都不发生
我用
if(JOptionPane.showConfirmDialog(container, "是否保存?", "是否存",JOptionPane.YES_NO_CANCEL_OPTION) == JOptionPane.CANCEL_OPTION)
          { return; }
它还是给关闭了 
  请问要怎么弄?

解决方案 »

  1.   


    int x = JOptionPane.showConfirmDialog(null, "确认要退出么?", "退出", JOptionPane.YES_NO_OPTION); if (x == JOptionPane.YES_OPTION) {
            System.exit(0);
    }
      

  2.   

    楼上正解加个if判断下。
    if(x==JOptionPane.YES_OPTION)){
    /////////////////////////
    }
    else{
    ////////////////////////
    }
      

  3.   


    int x = JOptionPane.showConfirmDialog(null, "确认要退出么?", "退出",
    JOptionPane.YES_NO_OPTION);
    if (x == JOptionPane.YES_OPTION) {
    System.exit(0);
    }
    版都排出去了怎么-。-