javajavafxwebviewjavafx-webengine

JavaFX WebView doesn't load content


I'm trying to load a Google Maps page inside my JavaFX application using webView and webEngine. Somehow, it doesn't load anything and I don't know why. Could you please help?

@FXML WebView webView;
WebEngine webEngine;
webView = new WebView();
webEngine = webView.getEngine();
webEngine.load("https://maps.google.de");

Solution

  • @FXML WebView webView;
    WebEngine webEngine;
    webEngine = webView.getEngine();
    webEngine.load("https://maps.google.de");
    

    Removing webView = new WebView(); fixed it!