title: JOptionPane YES/No Options Confirm Dialog Box Issue
body: <p>I've created a <code>JOptionPane</code> and it only has two buttons <code>YES_NO_OPTION</code> .</p>
  
  <p>After <code>JOptionPane.showConfirmDialog</code> pops out , I want to click <code>YES BUTTON</code> to continue opening the <code>JFileChooser</code> and if I clicked <code>NO BUTTON</code> it should cancel the operation.</p>
  
  <p>It seems pretty easy but I'm not sure where is my mistake.</p>
  
  <p>Code Snippet:</p>
  
  <pre><code>if (textArea.getLineCount() &gt;= 1) {  //The condition to show the dialog if there is text inside the textArea
  
      int dialogButton = JOptionPane.YES_NO_OPTION;
      JOptionPane.showConfirmDialog (null, "Would You Like to Save your Previous Note First?","Warning",dialogButton);
  
      if (dialogButton == JOptionPane.YES_OPTION) { //The ISSUE is here
  
      JFileChooser saveFile = new JFileChooser();
      int saveOption = saveFile.showSaveDialog(frame);
      if(saveOption == JFileChooser.APPROVE_OPTION) {
  
      try {
          BufferedWriter fileWriter = new BufferedWriter(new FileWriter(saveFile.getSelectedFile().getPath()));
          fileWriter.write(textArea.getText());
          fileWriter.close();
      } catch(Exception ex) {
  
      }
  }
  </code></pre>