Once the applet has been initialized, we can ask for an instance of the applet
let's take a look:
var js2jfx = document.getElementById("js2jfx") —this
line obtains a reference to the JavaFX applet (see previous bullet).
This object is used to communicate with the JavaFX applet directly.
Accessing JavaFX public properties—Now that we have a reference
update or access the value of any JavaFX script-level property.
For instance, js2jfx.script.textContent = document.
object msg to the JavaFX script-level property textContent .
Calling JavaFX functions—similar to accessing JavaFX properties,
js2jfx.script can also be used to invoke JavaFX public
script.applyEffect(...) invokes the JavaFX public script-level
function applyAffect(number) declared in the JavaFX code.
F The HTML form —the remainder of the HTML source code contains the HTML
form used to control the applet. When the Set button is clicked, it invokes the
object (see previous bullet).
As of version 6, update 18 of the Java's consumer runtime (JRE)
when this was tested, the features presented here only worked with
the next generation Java Plugin running on the Windows platform.
By the time you read this, support may be available for browsers on
variables and functions. This mechanism offers much more than depicted in the recipe above;
let's explore some additional capabilities.
When updating JavaFX script-level properties or invoking a parameterized function, the
Java browser plugin framework will conduct an automatic type conversion to handle data