Hello
I tried to open a simple demo based on WebGL in a WebView, please find my source code below:
package io.sourceforge.tuer;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.VBox;
import javafx.scene.web.WebView;
import javafx.stage.Stage;
public class Main extends Application {
public static void main(final String[] args) {
launch(args);
}
@Override
public void start(final Stage primaryStage) {
primaryStage.setTitle("JavaFX WebView Example");
WebView webView = new WebView();
webView.getEngine().load("https://webglsamples.org/blob/blob.html");
VBox vBox = new VBox(webView);
Scene scene = new Scene(vBox, 960, 600);
primaryStage.setScene(scene);
primaryStage.show();
}
}
However, I just get the following message instead of seeing the blobs moving:
This page requires a browser that supports WebGL.
Click here to upgrade your browser.
It’s strange as a member of Gluon support team told me that WebGL is supported by JavaFX/OpenJFX.