JavaFX resource handling: Load HTML files in WebView
You get this exception because your url variable is null on this line: String url = WebViewSample.class.getResource(“/map.html”).toExternalForm(); You have several options with getResource(): If the resource is the same directory as the class, then you can use String url = WebViewSample.class.getResource(“map.html”).toExternalForm(); Using beginning slash(“https://stackoverflow.com/”) means relative path to the project root.: In your particular case, … Read more