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!

Community
  • 1
  • 1
Andrea
  • 129
  • 2
  • 15

1 Answers1

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

Community
  • 1
  • 1
Davit Mumladze
  • 918
  • 2
  • 9
  • 25
  • 1
    Wow man, thanks! The second link really made the difference. I copied the code from the Trustmanager, that Viet posted and it worked fine. The thing with the TSL 1.0 or 1.2 version made no difference for me. I forgot to mention that i use JDK 1.8. – Andrea Feb 07 '16 at 11:59