hal hal - 1 year ago 72
Java Question

How to load locally stored page to WebView controll?

I have WebView control in my application.

private WebView webview = new WebView();

i use it like this


and it works well, but how do i use it to load locally stored page.
For example:


Answer Source

You can create the a URL to pass to the WebEngine from a File or Path

File file = ...
URL url = file.toURI().toURL();
Path path = ...
URL url = path.toUri().toURL();
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download