final Point clickedPos = SwingUtilities.convertPoint( desktop, x, y, comp );
final Point clickedPos = convertPoint( desktop, x, y, comp );
    private void sendAWTMouseEvent( int x, int y, boolean pressed, int button ) {        Component comp = componentAt( x, y, desktop, false );        final int eventType;        if ( button >= 0 ) {            eventType = pressed ? MouseEvent.MOUSE_PRESSED : MouseEvent.MOUSE_RELEASED;        }        else {            eventType = getButtonMask( -1 ) == 0 ? MouseEvent.MOUSE_MOVED : MouseEvent.MOUSE_DRAGGED;        }        final long time = System.currentTimeMillis();        if ( lastComponent != comp ) {            //enter/leave events            while ( lastComponent != null && ( comp == null || !SwingUtilities.isDescendingFrom( comp, lastComponent ) ) ) {                final Point pos = SwingUtilities.convertPoint( desktop, x, y, lastComponent );                sendExitedEvent( lastComponent, getCurrentModifiers( button ), pos );                lastComponent = lastComponent.getParent();            }            final Point pos = SwingUtilities.convertPoint( desktop, x, y, lastComponent );            if ( lastComponent == null ) {                lastComponent = desktop;            }            sendEnteredEvent( comp, lastComponent, getCurrentModifiers( button ), pos );            lastComponent = comp;            downX = Integer.MIN_VALUE;            downY = Integer.MIN_VALUE;            lastClickTime = 0;        }        boolean clicked = false;        if ( comp != null ) {            if ( button >= 0 ) {                if ( pressed ) {                    grabbedMouse = comp;                    grabbedMouseButton = button;                    downX = x;                    downY = y;                    setFocusOwner( componentAt( x, y, desktop, true ) );                }                else if ( grabbedMouseButton == button && grabbedMouse != null ) {                    comp = grabbedMouse;                    grabbedMouse = null;                    if ( Math.abs( downX - x ) <= MAX_CLICKED_OFFSET && Math.abs( downY - y ) < MAX_CLICKED_OFFSET ) {                        if ( lastClickTime + DOUBLE_CLICK_TIME > time ) {                            clickCount++;                        }                        else {                            clickCount = 1;                        }                        clicked = true;                        lastClickTime = time;                    }                    downX = Integer.MIN_VALUE;                    downY = Integer.MIN_VALUE;                }            }            else if ( grabbedMouse != null ) {                comp = grabbedMouse;            }            final Point pos = SwingUtilities.convertPoint( desktop, x, y, comp );            final MouseEvent event = new MouseEvent( comp,                    eventType,                    time, getCurrentModifiers( button ), pos.x, pos.y, clickCount,                    button == 1 && pressed, button >= 0 ? button : 0 );            dispatchEvent( comp, event );            if ( clicked ) {                // CLICKED seems to need special glass pane handling o_O                comp = componentAt( x, y, desktop, true );                final Point clickedPos = SwingUtilities.convertPoint( desktop, x, y, comp );                final MouseEvent clickedEvent = new MouseEvent( comp,                        MouseEvent.MOUSE_CLICKED,                        time, getCurrentModifiers( button ), clickedPos.x, clickedPos.y, clickCount,                        false, button );                dispatchEvent( comp, clickedEvent );            }        }        else if ( pressed ) {            // clicked no component at all            setFocusOwner( null );        }    }