Java Reference
In-Depth Information
9
Add JavaFX to Web
Pages with Applets
“Civilization advances by extending the number of important
operations which we can perform without thinking of them.”
—Alfred North Whitehead
JavaFX and Applets
JavaFX makes applet development and deployment easy!! I know what you are
thinking: “Applets, aren't they those things we heard about 10 years ago when
Java was brand new? Aren't they slow and unreliable?” Well not anymore. Since
the release of Java 6 update 10, the entire applet framework has been redone and
JavaFX leverages this to make it possible to run any JavaFX application as an
applet without code changes. To start with, let's see how easy it is to deploy a
JavaFX application as an applet within an HTML page. Next, we will explore a
new feature that allows you to drag the applet off the HTML page and onto your
desktop. Then we will cover interaction between JavaFX and JavaScript. We will
also cover Java Web Start, which is another way to easily install a JavaFX appli-
cation from an HTML page directly to the desktop.
Deploying a JavaFX Application
as an Applet
The first step is to write your JavaFX application. For now, there is nothing out
of the ordinary you have to do. Furthermore, you can run and test your JavaFX
235
 
 
 
Search WWH ::




Custom Search