caretPos += s.length(); outputTextArea.setCaretPosition(caretPos);
outputTextArea.setCaretPosition(outputTextArea.getText().length());
    private void addToTextArea(String s) {        outputTextArea.append(s);        caretPos += s.length();        outputTextArea.setCaretPosition(caretPos);        outputTextArea.getCaret().setVisible(true);        outputTextArea.repaint();    }