Part of the appeal of JavaFX as a browser-based deployment platform is its complete integration support between the browser and your JavaFX applets. When you deploy an applet, the new Java Plugin (see Packaging your app as an Applet) provides full two-way programmatic integration between your applet and JavaScript. In this recipe, we will see how you can use JavaScript to update attributes and invoke functions from an embedded applet.
Before you embark on the techniques presented in this recipe, you should be familiar with the deployment of your JavaFX applications as browser-embedded applets. If you are not, review the recipe Packaging your app as an Applet, presented earlier in this chapter. Secondly, since applets are embedded in HTML pages, you will need to have working knowledge of basic HTML and JavaScript. If you are not familiar with either, there are numerous resources online, including http://www.w3schools.com/html/ for...