--- old/src/java.desktop/share/classes/javax/swing/text/WrappedPlainView.java 2018-06-07 16:33:57.945573900 +0530 +++ new/src/java.desktop/share/classes/javax/swing/text/WrappedPlainView.java 2018-06-07 16:33:56.964949400 +0530 @@ -364,7 +364,8 @@ this, p0); } else { p = p0 + Utilities.getTabbedTextOffset(segment, metrics, - tabBase, tabBase + currentWidth, + (float)tabBase, + (float)(tabBase + currentWidth), this, p0, false); } SegmentCache.releaseSharedSegment(segment); @@ -847,8 +848,8 @@ Segment segment = SegmentCache.getSharedSegment(); loadText(segment, p0, p1); int n = Utilities.getTabbedTextOffset(segment, metrics, - alloc.x, x, - WrappedPlainView.this, p0); + (float)alloc.x, (float)x, + WrappedPlainView.this, p0, true); SegmentCache.releaseSharedSegment(segment); return Math.min(p0 + n, p1 - 1); }