boolean () { Point pointOfCaret = editor.offsetToXY(editor.getCaretModel().getOffset()); Rectangle area = editor.getScrollingModel().getVisibleAreaOnScrollingFinished(); return area.contains(pointOfCaret); }