Java Reference
In-Depth Information
11
JavaFX and Java
Technology
“In art there are only fast or slow developments.
Essentially it is a matter of evolution, not revolution.”
—Bela Bartok
A real advantage of JavaFX is that the entire platform is extended by the full
power and capabilities of the Java platform. This allows existing Java frame-
works and custom libraries to fully participate in a JavaFX application.
At its core, JavaFX classes are compiled into Java bytecode, so JavaFX, at the
runtime level, is tightly integrated with the Java platform. However, the JavaFX
language is a declarative language with an object-oriented flavor, whereas Java is
an object-oriented imperative language. The main difference is that in JavaFX you
tell the system what needs to be done and the runtime determines how to do it; in
Java, you explicitly program what is to be done. When crossing the JavaFX/Java
boundary, you must keep this difference in mind.
Basically, the JavaFX runtime is always in the background, so you need to be
careful how you interact with JavaFX from Java. Nonetheless, it is still possible
to leverage Java classes from JavaFX, and with a little effort, you can leverage
JavaFX scripts within your Java code. This chapter describes some of the basic
rules that must be obeyed when crossing the JavaFX/Java boundary.
The first part of this chapter discusses the rules for using Java objects and classes
within JavaFX and you should be familiar with this to write JavaFX scripts.
However, the last two sections, Java Scripting and JavaFX Reflection, discuss
279
 
Search WWH ::




Custom Search