<p>What's the easiest way to centre a <code>java.awt.Window</code>, such as a <code>JFrame</code> or a <code>JDialog</code>?</p>

From
this link
If you are using Java 1.4 or newer,
  you can use the simple method
  setLocationRelativeTo(null) on the
  dialog box, frame, or window to center
  it.