When the HTML file is accessed through the web, the browser renders the embedded applet
inside the HTML page as shown in the following screenshot:
If you are running 64-bit Windows 7, you must run your applets in a 64-bit
browser for your applet to run properly.
How it works...
The applet runtime is designed to run Java desktop applications inside the browser. Unlike
traditional desktop applications, applets are rendered directly within the web page using
a frameless window, as shown in the previous screenshot. Users are not able to minimize,
resize, or close the applet while within the browser.
Let's examine how we achieved this in our recipe:
F The JavaFX code—the code presented in the recipe is purely illustrative. There is
nothing special about it. However, notice that we are not using any applet-specific
APIs in the code that hints at the targeted environment. That is the power of the
unified development and deployment model in JavaFX. The developer concentrates
on creating the application and the tool chain handles building the code for the
F The HTML file—the packager tool generates a sample HTML file,which shows you
within th e HTML page.
It calls the function javafx() , which takes as parameter an
associative array with configuration settings, including the JAR
name, applet dimensions, main class, and name of application.