code: private static Component getCurrentModal_(RootPaneContainer rootPane) {
  	synchronized (modals) {
  	  Modal modal = modals.get(rootPane);
  	  if (modal != null) {
  		if (modal.getSize() > 0) {
  		  return modal.components.get(modal.components.size() - 1);
  		}
  	  }
  	  return null;
  	}
    }
docs: Get the current modal component of a specific RootPaneContainer.
  
  @param rootPane
  the RootPaneContainer with a modal
  @return Component or <code>NULL</code>