title: Java: JFrame.setLocationRelativeTo(null) not centering the window on Ubuntu 10.04 / gnome 2.30.2 with OpenJDK 1.6.0_18
body: <p>Sample code:</p>
  <pre><code>    JFrame jFrame = new JFrame(&quot;Test&quot;);
      jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      jFrame.setLocationRelativeTo(null);
      jFrame.setSize(600, 600);
      jFrame.pack();
      // jFrame.setLocationRelativeTo(null); // same results
      jFrame.setVisible(true);
  </code></pre>
  <p><a href="https://i.stack.imgur.com/31x9v.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/31x9v.png" alt="screenshot" /></a></p>
  
  <p>Is this the OpenJDK's fault? I recall hearing it wasn't as good as Sun's, but since it became the standard for Ubuntu or whatever I decided to go along with it. The program is probably gonna run on windows, so I suppose I'm gonna have to check there... Any easy way to fix this in a platform independent way without breaking it where it already works?</p>