void () { if (myPopup == null || isBusy()) return; final Window popupWindow = getContentWindow(myContent); if (popupWindow == null) return; Rectangle bounds = popupWindow.getBounds(); ScreenUtil.moveRectangleToFitTheScreen(bounds); // calling #setLocation or #setSize makes the window move for a bit because of tricky computations // our aim here is to just move the window as-is to make it fit the screen // no tricks are included here if (LOG.isDebugEnabled()) { LOG.debug("MoveToFitScreen x = " + bounds.x + " y = " + bounds.y + " width = " + bounds.width + " height = " + bounds.height); } popupWindow.setBounds(bounds); updateMaskAndAlpha(popupWindow); }