void dispatchComponentEvent(final ComponentEvent e) {
    int id = e.getID();
    if (WindowEvent.WINDOW_CLOSED == id || (ComponentEvent.COMPONENT_HIDDEN == id && e.getSource() instanceof Window)) {
      dispatchHiddenOrClosed((Window)e.getSource());
    }
    // clear obsolete reference on root frame
    if (WindowEvent.WINDOW_CLOSED == id) {
      Window window = (Window)e.getSource();
      if (JOptionPane.getRootFrame() == window) {
        JOptionPane.setRootFrame(null);
      }
    }
  }
void dispatchComponentEvent(final ComponentEvent e)