private void doAutoScroll(final JTextArea ta,final boolean scroll){
  SwingUtilities.invokeLater(null);
}

private void doAutoScroll ( final JTextArea ta , final boolean scroll ) { SwingUtilities . invokeLater ( null ) ; }
method to position caret at end of jtextarea ta when scroll true .
