void () { if (isDisposed()) return; final Point newOwnerPoint = myOwnerWindow.getLocationOnScreen(); int deltaX = myLastOwnerPoint.x - newOwnerPoint.x; int deltaY = myLastOwnerPoint.y - newOwnerPoint.y; myLastOwnerPoint = newOwnerPoint; final Window wnd = SwingUtilities.getWindowAncestor(getContent()); if (!wnd.isShowing()) return; final Point current = wnd.getLocationOnScreen(); setLocation(new Point(current.x - deltaX, current.y - deltaY)); }