I am creating a web browsing exp with some drawing tool with JAVA FX 11 but while trying to load the javascript code which has let
and const
used these variables are simply getting ignored and throwing the exceptions. I am using maven 3.8.0, Java 1.8 and JavaFX 11.
The code is as follows:
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>12-ea+9</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-web</artifactId>
<version>12-ea+9</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-swing</artifactId>
<version>12-ea+9</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>12-ea+9</version>
</dependency>
and Java Code
public static void main(String[] urls) {
String javaVersion = System.getProperty("java.version");
String javafxVersion = System.getProperty("javafx.version");
System.out.println(javaVersion + " java....... fx........ " + javafxVersion);
Application.launch(urls);
}
@Override
public void start(Stage stage) throws Exception {
Parameters parameters = getParameters();
List<String> raw = parameters.getRaw();
String url = "http://example.com/";
if (raw.size() != 0) {
url = raw.get(0);
}
/*
* WebConsoleListener.setDefaultListener((webView, message, lineNumber,
* sourceId) -> { System.out.println(message + "[at " + lineNumber + "] [in " +
* sourceId + "]"); });
*/
Pane root = new Pane();
WebView webView = new WebView();
WebEngine webEngine = webView.getEngine();
// Load the Google web page
webEngine.load(url);
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
Scene scene = new Scene(root);
stage.setScene(scene);
stage.setTitle("IWB");
stage.show();
// mainStage = stage;
root.getChildren().add(webView);
webView.setMinSize((screenSize.getWidth() - 120), (screenSize.getHeight() - 60));
btns.setMinHeight(screenSize.getHeight() - 60);
stage.setOnCloseRequest(e -> {
// Platform.exit();
// System.exit(0);
});
// Platform.setImplicitExit(false);
}