JScrollPane
Previous    Next    Home    Source Code    Package

Notes
  1. The problem with the previous example is that the text may fall off the bottom of the screen if you click the button too many times. To fix that add a JScollPane around the JTextArea.
  2. Use
       area.setCaretPosition(area.getDocument().getLength());
    
    to make sure the bottom of the JTextArea shows the latest addition.