Java Interoperability
JavaFX has full access to all Java code. You can instantiate, extend and use all Java classes from JavaFX.
import java.util.ArrayList; // import Java class
def list = new ArrayList(3); // create new instance using new
list.add("a"); list.add("b"); list.add("c"); // call methods
var r;
for (i in list) // for can use any Iterable
r = "{r}{i}";
assert(r == "abc");
def t = new java.util.Date(); // without import
def ms = t.time; // getTime is no property
def ms = t.getTime();
def f = new java.io.File("example.dat");
f.<<delete>>(); // escape syntax for keywords (more)
There is currently no direct support for creating and using JavaFX classes from Java. You can start a JavaFX script from Java using the Scripting API though. If you need to call JavaFX code from Java, you should write an interface in Java and implement it in JavaFX.

