void (final int x, final int y) { if (myDialog == null || !myDialog.isShowing()) { return; } final Point _p = new Point(x, y); final JRootPane pane = SwingUtilities.getRootPane(myDialog); SwingUtilities.convertPointFromScreen(_p, pane); myDialog.setLocation(_p.x, _p.y); }