boolean (JDialog dialog) { JRootPane rootPane = dialog != null && dialog.isResizable() ? dialog.getRootPane() : null; if (rootPane == null) return false; Rectangle screenRectangle = ScreenUtil.getScreenRectangle(dialog); return dialog.getBounds().equals(screenRectangle) && rootPane.getClientProperty(NORMAL_BOUNDS) instanceof Rectangle; }