public static Dialog findModalestDialog() {
		List<Dialog> openModalDialogs = getOpenModalDialogs();
		if (openModalDialogs.size() == 0) {
			return null;
		}

		final KeyboardFocusManager kfm = KeyboardFocusManager.getCurrentKeyboardFocusManager();
		final Component permanentFocusOwner = kfm.getPermanentFocusOwner();
		if (permanentFocusOwner == null) {
			// no focus owner; any dialog should do
			return pickAModalDialog(openModalDialogs);
		}

		// check first for modal dialogs in the focused hierarchy
		Dialog theModalest = findParentModalDialog(permanentFocusOwner, openModalDialogs);
		theModalest = findYoungestChildDialogOfParentDialog(theModalest, openModalDialogs);
		theModalest = checkForActiveModalDialog(theModalest);
		if (theModalest != null) {
			return theModalest;
		}

		// Now, pick one of the open modal dialogs
		return pickAModalDialog(openModalDialogs);
	}
Returns true if there are one or more modal dialogs displayed in the current JVM.
@return true if there are one or more modal dialogs displayed in the current JVM.
Ghidra/Framework/Generic/src/main/java/generic/util/WindowUtilities.java