question: public void replaceLineAt ( int pos , String newLines ) throws BadLocationException { Element e = getParagraphElement ( pos ) ; replace ( e . getStartOffset ( ) , getElementLength ( e ) , newLines , null ) ; }
target:  Replace the line at given position with the given string, which can span multiple lines