private void addHTML(String text) {
   HTMLDocument hdoc = (HTMLDocument) doc;
   try {
     hdoc.insertAfterEnd(hdoc.getCharacterElement(hdoc.getLength()), text);
   } catch (BadLocationException | IOException ex) {
     ex.printStackTrace();
   }
 }
Esempio n. 2
0
 public void appendToEnd(String text) {
   Element root = document.getDefaultRootElement();
   try {
     document.insertAfterEnd(root.getElement(root.getElementCount() - 1), text);
   } catch (BadLocationException e) {
     logger.error("Insert in the HTMLDocument failed.", e);
   } catch (IOException e) {
     logger.error("Insert in the HTMLDocument failed.", e);
   }
 }