int caret = textArea.getLineStartOffset( Math.min(textArea.getLineCount() - 1, line + visibleLines));
line = Math.min(textArea.getLineCount() - 1, line + visibleLines); caret = textArea.getLineStartOffset(line) + textArea.xToOffset(line,magic + 1);
	public void actionPerformed(ActionEvent evt)	{		View view = getView(evt);		JEditTextArea textArea = view.getTextArea();		int lineCount = textArea.getLineCount();		int firstLine = textArea.getFirstLine();		int visibleLines = textArea.getVisibleLines();		int line = textArea.getCaretLine();		firstLine += visibleLines;		if(firstLine + visibleLines >= lineCount - 1)			firstLine = lineCount - visibleLines;		textArea.setFirstLine(firstLine);		int caret = textArea.getLineStartOffset(			Math.min(textArea.getLineCount() - 1,			line + visibleLines));		if(select)			textArea.select(textArea.getMarkPosition(),caret);		else			textArea.setCaretPosition(caret);	}