void () { TextRange composedTextRange = myEditor.getComposedTextRange(); if (composedTextRange != null) { Point2D p1 = myView.offsetToXY(Math.min(composedTextRange.getStartOffset(), myDocument.getTextLength()), true, false); Point2D p2 = myView.offsetToXY(Math.min(composedTextRange.getEndOffset(), myDocument.getTextLength()), false, true); int y = (int)p1.getY() + myAscent + 1 + myYShift; myGraphics.setStroke(IME_COMPOSED_TEXT_UNDERLINE_STROKE); myGraphics.setColor(myEditor.getColorsScheme().getDefaultForeground()); LinePainter2D.paint(myGraphics, (int)p1.getX(), y, (int)p2.getX(), y); } }