I would like to know more about how I can import a JavaFX library while using JavaScript.
This is for trying to use a JavaScript applet on my mobile devices, while importing and using a JavaFX Form container and its controls.
Here's what I have done so far:
Here I have written this code snippet in Microsoft Notepad.
I have successfully compiled and run it using Java at the Windows command prompt.
What I want to know now is how would I import a JavaFX library using JavaScript.
All users are welcome to add some files using the .js format extension.
javac --module-path C:\Users\john2\Downloads\openjfx-22.0.2_windows-x64_bin-sdk\javafx-sdk-22.0.2\lib --add-modules javafx.controls,javafx.fxml HelloWorldFX.java
java --module-path C:\Users\john2\Downloads\openjfx-22.0.2_windows-x64_bin-sdk\javafx-sdk-22.0.2\lib --add-modules javafx.controls,javafx.fxml HelloWorldFX
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
public class HelloWorldFX extends Application {
@Override
public void start(Stage stage) {
String javaVersion = System.getProperty("java.version");
String javafxVersion = System.getProperty("javafx.version");
Label l = new Label("Hello World running on JavaFX " + javafxVersion + " on top of Java " + javaVersion + ".");
Scene scene = new Scene(new StackPane(l), 640, 480);
stage.setScene(scene);
stage.show();
}
public static void main(String[] args) {
launch();
}
}