public void addIncrement(String text) throws BadLocationException {
  if (text == null || text.length() == 0 || text.equals("\n")) {
    return;
  }
 else   if (text.charAt(text.length() - 1) != 10) {
    throw new BadLocationException("Input does not end with newline");
  }
  document.replace(document.getLength(),0,text);
}

public void addIncrement ( String text ) throws BadLocationException { if ( text == null || text . length ( ) == 0 || text . equals ( "\n" ) ) { return ; } else if ( text . charAt ( text . length ( ) - 1 ) != 10 ) { throw new BadLocationException ( "Input does not end with newline" ) ; } document . replace ( document . getLength ( ) , 0 , text ) ; }
add the increment the argument should be a relatively short string , i . e . no more than what tlc prints out in a single instant . it is also better if when at least one tlc end tag is part of the string passed to this method , the string terminates with a tlc end tag .
