public void append(String s) {
        while (isPaused) {
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
        super.append(s);
        if (autoScroll) {
            int length = getText().length();
            if (length > 0) {
                setCaretPosition(length - 1);
            }
        }
    }