JavaFX webview shows blank page on certain website

Refresh

February 2019

Views

2.1k time

1

i am struggeling with some problem here to load a website into the webviewer.

I followed the code from here and changed it towards

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.Region;
import javafx.scene.paint.Color;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
import javafx.stage.Stage;

public class WebViewSample extends Application {
    private Scene scene;
    @Override public void start(Stage stage) {
          //   create the scene
        scene = new Scene(new Browser(),900,600, Color.web("#666970"));
        stage.setScene(scene);
         stage.show();
    }

    public static void main(String[] args){
        launch(args);
    }
}
class Browser extends Region {

    final WebView browser = new WebView();
    final WebEngine webEngine = browser.getEngine();

    public Browser() {

        webEngine.setJavaScriptEnabled(true);
           //  load the web page
        webEngine.load("https://www.immomapping.com/");
          //  add the web view to the scene
        getChildren().add(browser);
    }
}

It shows me just a blank page. I tried to check for here proxies but aint going anywhere.

Can somebody help me? The website is in german but should not matter.

Or does somebody know how to operate on Websites (opened in a browser, e.g. internet explorer :X ) like it is able to do with VBA?

Thanks in advance!

1 answers

4

The reason is HTTPS protocol and you have certificate problem

Here are similar problems JavaFX WebView can't load certain sites

JavaFx Webview JDK 8 can not load self signed certificate