Here you can find the source of retargetMouseEvent(int id, MouseEvent e, Component target)
public static void retargetMouseEvent(int id, MouseEvent e, Component target)
//package com.java2s; //License from project: Open Source License import java.awt.Component; import java.awt.Point; import java.awt.event.MouseEvent; import javax.swing.SwingUtilities; public class Main { public static void retargetMouseEvent(int id, MouseEvent e, Component target)//from ww w . j a v a 2 s . com /* */{ /* 3326 */if ((target == null) || ((target == e.getSource()) && (id == e.getID()))) { /* 3327 */return; /* */} /* 3329 */if (e.isConsumed()) { /* 3330 */return; /* */} /* */ /* 3337 */Point p = SwingUtilities.convertPoint( (Component) e.getSource(), e.getX(), e.getY(), target); /* */ /* 3340 */MouseEvent retargeted = new MouseEvent(target, id, e.getWhen(), e.getModifiersEx() | e.getModifiers(), p.x, p.y, e.getClickCount(), e.isPopupTrigger()); /* */ /* 3348 */target.dispatchEvent(retargeted); /* */} }