int offset = -1;
void showDropTargetEffect(int effect, int x, int y) {	if ((effect & DND.FEEDBACK_SELECT) != 0) {		Point pt = text.getDisplay().map(null, text, x, y);		int oldOffset = text.getCaretOffset();		try {			text.setFocus();			int offset = text.getOffsetAtLocation(pt);			if (offset != oldOffset) {				OS.ImageList_DragShowNolock(false);				text.setCaretOffset(offset);				OS.ImageList_DragShowNolock(true);			}		} catch (IllegalArgumentException ex) {			int maxOffset = text.getCharCount();			Point maxLocation = text.getLocationAtOffset(maxOffset);			int offset = -1;			if (pt.y >= maxLocation.y) {				if (pt.x >= maxLocation.x) {					offset = maxOffset;				} else {					offset = text.getOffsetAtLocation(new Point(pt.x, maxLocation.y));				}			} else {				offset = maxOffset;			}			if (offset != -1 && offset != oldOffset) {				OS.ImageList_DragShowNolock(false);				text.setCaretOffset(offset);				OS.ImageList_DragShowNolock(true);			}		}	}}