void (DocumentEvent e) { Rectangle viewRect = getScrollingModel().getVisibleArea(); Point pos = visualPositionToXY(getCaretModel().getVisualPosition()); myCaretUpdateVShift = pos.y - viewRect.y; mySizeContainer.beforeChange(e); }