title: Unable to focus JOptionPane on foreground with default frame
body: <p>I have a piece of code in my program where in I need to display an error message. Code:</p>
  
  <pre><code>String ErrorMsg=" Error to be Diplayed ";
  JOptionPane.showMessageDialog(null, ErrorMsg, "Failure", JOptionPane.ERROR_MESSAGE);
  </code></pre>
  
  <p>Note: Default frame is used.</p>
  
  <p>The message is successfully displayed, but before acknowledging by pressing "OK" button if I try any other successful flow the message box control is lost and message box won't be on foreground blocking even the successive flows.</p>
  
  <p><strong>I want the Message Box to be on the foreground always</strong> until the user presses "OK" button, rather losing focus and getting hidden. How to do that?</p>