public void addLine(String text) throws BadLocationException {
  if (text == null || text.length() == 0 || text.equals("\n")) {
    return;
  }
  document.replace(document.getLength(),0,text);
}

public void addLine ( String text ) throws BadLocationException { if ( text == null || text . length ( ) == 0 || text . equals ( "\n" ) ) { return ; } document . replace ( document . getLength ( ) , 0 , text ) ; }
contrary to addincrement ( string ) , this method does not verify that the input terminates with the newline separator . it is up to the caller to only provide valid input .
