title: Center alignment of Jframe
body: <p>I would like to know if there is an option to center a jframe to the center of the screen(monitor)?
  I have tried with co-ordinates but its not exact at the center.
  This is what I have:</p>
  
  <pre><code> Dimension ss = Toolkit.getDefaultToolkit ().getScreenSize ();
          Dimension frameSize = new Dimension ( 800, 300 );
          frame1.setBounds ( ss.width / 2 - frameSize.width / 2, 
                            ss.height / 2 - frameSize.height / 2,
                            frameSize.width, frameSize.height );
  </code></pre>
  
  <p>PS:If the question is repeated please post the link.</p>
  
  <p>Thank you.</p>