Append text WebEngine - JavaFX
问题 How can I append text to webengine? I tried this: public TabMessage(String title) { super(title); view = new WebView(); engine = view.getEngine(); engine.loadContent("<body></body>"); view.setPrefHeight(240); } private void append(String msg){ Document doc = engine.getDocument(); Element el = doc.getElementById("body"); String s = el.getTextContent(); el.setTextContent(s+msg); } But document is null 回答1: You can also use JavaScript to do the append. final WebEngine appendEngine = view