void (@NotNull Graphics2D g) { TextRange composedTextRange = getComposedTextRange(); if (composedTextRange != null) { VisualPosition visStart = offsetToVisualPosition(Math.min(composedTextRange.getStartOffset(), myDocument.getTextLength())); int y = visibleLineToY(visStart.line) + getAscent() + 1; Point p1 = visualPositionToXY(visStart); Point p2 = logicalPositionToXY(offsetToLogicalPosition(Math.min(composedTextRange.getEndOffset(), myDocument.getTextLength()))); Stroke saved = g.getStroke(); BasicStroke dotted = new BasicStroke(1, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 0, new float[]{0, 2, 0, 2}, 0); g.setStroke(dotted); UIUtil.drawLine(g, p1.x, y, p2.x, y); g.setStroke(saved); } }