boolean (JRootPane rootPane) { if (rootPane != null) { final Object isDialog = rootPane.getClientProperty("DIALOG_ROOT_PANE"); return isDialog instanceof Boolean && ((Boolean)isDialog).booleanValue(); } return false; }