code: public static void closeModal(Component component) {
  	synchronized (modals) {
  	  RootPaneContainer frame = null;
  	  Modal modal = null;
  
  	  Iterator<Entry<RootPaneContainer, Modal>> it =
  		  modals.entrySet().iterator();
  	  while (it.hasNext()) {
  		Entry<RootPaneContainer, Modal> entry = it.next();
  		modal = entry.getValue();
  		frame = entry.getKey();
  		if (frame != null && modal != null
  			&& modal.components.contains(component)) {
  		  break;
  		} else {
  		  frame = null;
  		  modal = null;
  		}
  	  }
  	  if (frame != null && modal != null) {
  		modal.close(component);
  		if (modal.getSize() == 0) {
  		  modals.remove(frame);
  		}
  	  }
  	}
    }
docs: Close a specific modal component.
  
  @param component
  the modal's component