else { if (event.getID() == MouseEvent.MOUSE_RELEASED) clearSelectedPath(); }
  public void processMouseEvent(MouseEvent event)  {    Component source = ((Component) event.getSource());        // In the case of drag event, event.getSource() returns component    // where drag event originated. However menu element processing this     // event should be the one over which mouse is currently located,     // which is not necessary the source of the drag event.         Component mouseOverMenuComp;    // find over which menu element the mouse is currently located    if (event.getID() == MouseEvent.MOUSE_DRAGGED        || event.getID() == MouseEvent.MOUSE_RELEASED)      mouseOverMenuComp = componentForPoint(source, event.getPoint());    else      mouseOverMenuComp = source;    // Process this event only if mouse is located over some menu element    if (mouseOverMenuComp != null && (mouseOverMenuComp instanceof MenuElement))      {	MenuElement[] path = getPath(mouseOverMenuComp);	((MenuElement) mouseOverMenuComp).processMouseEvent(event, path,	                                                    manager);	// FIXME: Java specification says that mouse events should be	// forwarded to subcomponents. The code below does it, but	// menu's work fine without it. This code is commented for now.	  	/*	MenuElement[] subComponents = ((MenuElement) mouseOverMenuComp)	                              .getSubElements();    for (int i = 0; i < subComponents.length; i++)      {	  subComponents[i].processMouseEvent(event, path, manager);      }	*/      }  }