void (Graphics2D g) { if (myInputMethodRequestsHandler != null && myInputMethodRequestsHandler.composedText != null) { VisualPosition visStart = offsetToVisualPosition( Math.min(myInputMethodRequestsHandler.composedTextStart, myDocument.getTextLength())); int y = visibleLineNumberToYPosition(visStart.line) + getLineHeight() - getDescent() + 1; Point p1 = visualPositionToXY(visStart); Point p2 = logicalPositionToXY( offsetToLogicalPosition(Math.min(myInputMethodRequestsHandler.composedTextEnd, 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); g.drawLine(p1.x, y, p2.x, y); g.setStroke(saved); } }