title: How to set JDialog position according to the parent JFrame?
body: <p>I am having one parent frame in my system and one dialog that I need to show on Click. But I need to show that dialog in the middle of the parent frame. All time. And that parent frame position may not be the same all the time. So how to set it all time in to the middle?</p>
  
  <p>I am Working on Swing <code>JFrame</code>.</p>
  
  <pre><code>com.verve.visdashboard.NewOkCancelDialog cancelDialog = new com.verve.visdashboard.NewOkCancelDialog(new FrameOwnserPnael(), true);
  cancelDialog.setLocationRelativeTo(new FrameOwnserPnael());
  cancelDialog.setLocationByPlatform(true);
  </code></pre>