public final void print(String value){
  try {
    Element rootElement=workDoc.getDefaultRootElement();
    int deleteLines=rootElement.getElementCount() - linesMax;
    for (int index=0; index < deleteLines; index++) {
      Element elem=rootElement.getElement(0);
      workDoc.remove(elem.getStartOffset(),elem.getEndOffset());
    }
    workDoc.insertString(workDoc.getLength(),value,null);
    textArea.setCaretPosition(workDoc.getLength());
  }
 catch (  Exception exc) {
    exc.printStackTrace();
  }
}

public final void print ( String value ) { try { Element rootElement = workDoc . getDefaultRootElement ( ) ; int deleteLines = rootElement . getElementCount ( ) - linesMax ; for ( int index = 0 ; index < deleteLines ; index ++ ) { Element elem = rootElement . getElement ( 0 ) ; workDoc . remove ( elem . getStartOffset ( ) , elem . getEndOffset ( ) ) ; } workDoc . insertString ( workDoc . getLength ( ) , value , null ) ; textArea . setCaretPosition ( workDoc . getLength ( ) ) ; } catch ( Exception exc ) { exc . printStackTrace ( ) ; } }
prints a string without adding a / n at the end .
