You need to read the local file as a URL so that WebEngine can find it. For example, you can find a file as a resource using
URL url = this.getClass().getResource("/com/cds/gui/webView/main.html"); webEngine.load(url.toString());
Or you can load the actual String path into a File object and use it to get the string URL.
File f = new File("full\\path\\to\\webView\\main.html"); webEngine.load(f.toURI().toString());
Hope this helps!
source share