setLocationRelativeTo
..これにより、ポップアップの左上のピクセルが親の中央のピクセルの上に設定されます。..
いいえ、違います!

この簡単な例で表示される3つのダイアログはそれぞれ、私が見る限り中央に配置されているように見えます。コードが間違った時間に呼び出していると推測することしかできません。setLocationRelativeTo
import javax.swing.*;
class CenterTheDialog {
CenterTheDialog() {
for (int ii=1; ii<4; ii++) {
JFrame f = new JFrame("Frame " + ii);
f.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
f.setSize(400,300);
f.setLocationByPlatform(true);
f.setVisible(true);
JDialog d = new JDialog(f);
d.setSize(300,200);
d.setLocationRelativeTo(f);
d.setVisible(true);
}
}
public static void main(String[] args) {
SwingUtilities.invokeLater(() -> {
new CenterTheDialog();
});
}
}