I have a dialog class with a constructor like the following
public SampleDialog(JComponent parent, String title){
super((Frame)SwingUtilities.getAncestorOfClass(Frame.class, parent), title, false);
setLocationRelativeTo(parent);
init();
}
However, this positions the dialog so that it's upper right hand corner is in the center of it's parent. I would like the dialog's center on top of the parent component's center. How do I do this? Am I doing something wrong?