I'm trying to load multiple HTML pages into a JavaFx WebView from Java, but I only get the last added WebView added:
.java file
private void multiplePages() {
webEngine.load("file:D:/head.html");
webEngine.load("file:D:/body.html");
}
How can I go about adding multiple HTML pages into the same WebView
The HTML:
head.html
<div class="Head">
<h3 class="panel-title">Page Head</h3>
</div>
body.html
<div class="Head">
<h3 class="panel-title">Page Head</h3>
</div>
Thank you all in advance.
UPDATE:
The problem has been mentioned here: Cannot execute JavaScript when multiple WebViews are used at the same time, JDKJDK-8129398 as a bug.
This question is a follow-up to another I'd asked earlier: Error calling JavaScript from Java and netscape.javascript.JSException: SyntaxError: Unexpected keyword 'this'. Expected ')' to end a argument list. After digging around, I think this is the root of the problem, (that is, calling multiple HTMLs in the same WebView). I understand that it might not make much sense, but please note that the posted question is a very basic broken down piece of the actual problem I'm having. It's unavoidable that I have multiple HTMLs in the same WebView.