title: JAVA Message dialogs apear on top of each other
body: <p>I am writing a reminder program that pops up message dialogs. The problem is that all of the dialogs appear right on top of each other. I would prefer to have them cascade. Normally with other programs a dialog will apear then the next one will be slightly down and off to the side. My code snippet is as follows:</p>
  
  <pre><code>final JFrame frame = new JFrame( "A timer to be a reminder" );
  frame.setVisible( false ); 
  frame.setAlwaysOnTop(true);
  int result = JOptionPane.showConfirmDialog( frame, msg, "Timer", JOptionPane.DEFAULT_OPTION);
  </code></pre>
  
  <p>Can anyone point out how to get the desired behavior? </p>
  
  <p>This has been solved, I am attaching my code snippet so that someone else will be able to find it.</p>
  
  <pre><code>JFrame frame = new JFrame( "A timer to be a reminder" );
  frame.setLocationByPlatform( true );
  frame.setVisible( true ); 
  frame.setAlwaysOnTop(true);
  int result = JOptionPane.showConfirmDialog( frame, msg, "Timer", JOptionPane.DEFAULT_OPTION);
  frame.setVisible( false );
  frame = null;
  </code></pre>