title: Center JDialog over parent
body: <p>I have a Java swing application with a button that produces a popup window when a certain action is performed.  I'd like to align the center point of the popup window with the center point of the parent window when it is rendered.  How can I calculate the x,y coordinates to plug into <code>setLocation()</code> for the popup window?</p>
  
  <p>Just to clarify. I do not want the behavior of <code>setLocationRelativeTo()</code> because that sets the top-left pixel of the popup over the center pixel of the parent frame.  I want to set the center pixel of the popup over the center pixel of the parent frame. </p>