John Mary
John Mary

Reputation: 35

JavaFX webView blank showing window

How my webview is empty ? Why I have a blank window ?

Here my start method

BorderPane root = new BorderPane();
            Scene scene = new Scene(root,400,400);
            scene.getStylesheets().add(getClass().getResource("application.css").toExternalForm());
            scene.setFill(Color.BLUE);

            WebView webView = new WebView();
            WebEngine webEngine = webView.getEngine();
            //webEngine.load("https://www.google.fr");
            webEngine.loadContent("<p>qqqqqqq</p>");

            primaryStage.setScene(scene);
            primaryStage.show();

Upvotes: 0

Views: 1009

Answers (1)

jewelsea
jewelsea

Reputation: 159566

You don't add the WebView as a node in the scene.

root.setCenter(webView);

Upvotes: 1

Related Questions