How it works...
provided by the new Java Plugin, to create programmatic interactions between a JavaFX applet
can do the following:
F Access JavaFX resources by calling functions
F Access and update variable values
F Pass in complex types
F Traverse JavaFX's scene graph
Let us examine how the JavaFX script is set up in order to accept programmatic interaction
through public script-level variables and functions declared in the main application
class. Therefore, our code declares several script-level members that can be reached
JavaFX public variable textContent is bound to the content
property of the Text object. When a value is assigned to it, it will
update the content of the Text node.
Public variables textColor:String , textColorEnd:String ,
textStrokeColor:String , textStrokeWidth:String , and
textFont:String are bound to the style property of the Text
object. This will allow the appearance of the Text node to be updated
For instance, when the textColor = "red" , this will cause the
Text instance color to be updated to red.
The public function applyEffect(number):Void applies an
effect to the Text instance. The function can apply three effects to
the text including reflection, drop shadow, and lighting. Each effect
is associated with a number, where 0 = no effect. This makes easy
on the Text object.
form used to interact with the applet. Let's see how things operate in there:
<script/> block, is used to initialize the applet on the web page. We have added
id:"js2jfx" to the parameter map as a value that will be used as a reference
identifier for the JavaFX applet object. This makes it easy to look up the object