NumberGuess example - JavaFX script in an app client
By Tim Quinn-Oracle on Oct 12, 2007
Here is a JAR file containing the NetBeans project from which I built my JavaFX Script-enabled Number Guess example.
If you are interested, download the JAR and expand it into a directory. Then open it as a project from NetBeans. The directory includes a JavaFXJars directory which is empty. If you download the Filters.jar and javafxrt.jar files from the OpenJfx site and place them into that directory then the NetBeans build scripts as written should work to build the application. Or you can download the JavaFX JARs to somewhere else and revise the build->packaging settings for the EAR application to point to where you have stored the downloaded JARs.
This is all necessary because the JavaFX JARs are separate from the JRE; currently the most reliable way to make sure they are available to the client is to include them in the app. (You could place them in the lib/ext directory of the Java SE installation you are using but then you need to make sure to set up any client system that way if you want a JavaFX script to run from the app client. It's just safer to package the JARs with your app.) I tried to upload the NetBeans project with those JARs in the JavaFX directory but the upload seemed to large.
As packaged, you need to have Java SE 6 on the client for this to work. Otherwise the app client container will not find the required script-related classes in the Java runtime and will launch the main class instead of the main script.
After you deploy the EAR you can launch the client via Java Web Start using http://<host>:<port>/guess or directly by running the EAR project in NetBeans.