void (@NotNull DropTargetDragEvent e) { Point location = e.getLocation(); final CaretImpl caret = getCaretModel().getCurrentCaret(); caret.moveToVisualPosition(getTargetPosition(location.x, location.y, true, caret)); getScrollingModel().scrollToCaret(ScrollType.RELATIVE); requestFocus(); }