sourceTextAreaScrollPane.getViewport().setViewPosition(new Point(viewRect.x, viewRect.y));
viewport.setViewPosition(new Point(viewRect.x, viewRect.y));
            public void run() {                // Highlight the lines from the source annotation.                // Note that the source lines start at 1, while the line numbers                // in the text area start at 0.                try {                    int startLine = srcLine.getStartLine() - 1;                    int endLine = srcLine.getEndLine();                                        // Scroll the window so the annotation text will be SELECTION_VOFFSET                    // lines from the top.                    int viewLine = Math.max(startLine - SELECTION_VOFFSET, 0);                    int viewBegin = sourceTextArea.getLineStartOffset(viewLine);                    //sourceTextArea.scrollRectToVisible(sourceTextArea.modelToView(viewBegin));                    Rectangle viewRect = sourceTextArea.modelToView(viewBegin);                    sourceTextAreaScrollPane.getViewport().setViewPosition(new Point(viewRect.x, viewRect.y));                                        // Select (and highlight) the annotation.                    int selBegin = sourceTextArea.getLineStartOffset(startLine);                    int selEnd = sourceTextArea.getLineStartOffset(endLine);                    sourceTextArea.select(selBegin, selEnd);                    sourceTextArea.getCaret().setSelectionVisible(true);                } catch (javax.swing.text.BadLocationException e) {                    logger.logMessage(ConsoleLogger.ERROR, e.toString());                }            }