title: Prevent JOptionPane from closing until cancel or x button is clicked
body: <p>How can I prevent JOptionPane from closing until cancel or X button is clicked?  </p>
  
  <p>For example I have 3 text fields and buttons OK and Cancel if the user already filled the text fields and press the OK button the option pane will not close not until the user clicked the cancel or X button. Is there a simple way to do it?</p>