if (mouseEventTarget != null && mouseEventTarget.isShowing() && e.getID() != MouseEvent.MOUSE_ENTERED && e.getID() != MouseEvent.MOUSE_EXITED) { MouseEvent newEvt = SwingUtilities.convertMouseEvent(frame .getContentPane(), me, mouseEventTarget); mouseEventTarget.dispatchEvent(newEvt);
if (mouseEventTarget.isShowing() && e.getID() != MouseEvent.MOUSE_ENTERED && e.getID() != MouseEvent.MOUSE_EXITED) { MouseEvent newEvt = SwingUtilities.convertMouseEvent( frame.getGlassPane(), me, mouseEventTarget); mouseEventTarget.dispatchEvent(newEvt);
    private void handleEvent(AWTEvent e)    {      if (e instanceof MouseEvent)        {	  MouseEvent me = SwingUtilities.convertMouseEvent(frame.getRootPane()                                                                .getGlassPane(),	                                                   (MouseEvent) e,	                                                   frame.getRootPane()	                                                        .getGlassPane());	  acquireComponentForMouseEvent(me);	  // Avoid dispatching ENTERED and EXITED events twice.	  if (mouseEventTarget != null && mouseEventTarget.isShowing()	      && e.getID() != MouseEvent.MOUSE_ENTERED	      && e.getID() != MouseEvent.MOUSE_EXITED)	    {	      MouseEvent newEvt = SwingUtilities.convertMouseEvent(frame	                                                           .getContentPane(),	                                                           me,	                                                           mouseEventTarget);	      mouseEventTarget.dispatchEvent(newEvt);	      switch (e.getID())	        {		case MouseEvent.MOUSE_PRESSED:		  if (pressCount++ == 0)		    pressedComponent = mouseEventTarget;		  break;		case MouseEvent.MOUSE_RELEASED:		  // Clear our memory of the original PRESSED event, only if		  // we're not expecting a CLICKED event after this. If		  // there is a CLICKED event after this, it will do clean up.		  if (--pressCount == 0		      && mouseEventTarget != pressedComponent)		    pressedComponent = null;		  break;	        }	    }        }    }