code: private void close(Component component) {
  	if (components.size() > 0) {
  	  if (components.contains(component) == false) {
  		return;
  	  }
  
  	  components.remove(component);
  	  depths.remove(component);
  	  getModalPanel().removeAll();
  	  fireCloseActionListener(listeners.get(component));
  	  listeners.remove(component);
  
  	  if (components.size() > 0) {
  		showNextComponent();
  	  } else {
  		restoreRootPane();
  	  }
  	}
    }
docs: Close a modal
  
  @param component
  - the modal's component