|
|
Optimize with a SATA RAID Storage Solution
Range of capacities as low as $1250 per TB. Ideal if you currently rely on servers/disks/JBODs
Before you can create rich internet applications in JavaFX, you need to get to know the JavaFX Script language. So, fire up your NetBeans IDE and take Jeff Friesen's scripted tour of JavaFX Script's language features. Learn how JavaFX Script handles basic constructs like variable declarations, fundamental types, and expressions; then jump into advanced features such as sequences, replace triggers, and data binding. Level: Beginner to Intermediate
The first part of this six-part series introducing JavaFX presented a Main.fx script that describes a "hello world" type of application. I didn't bother to describe the script's code, at the time, because
it wouldn't make much sense without understanding the JavaFX Script language and associated APIs. In this article you'll be introduced to JavaFX Script, which should help you better understand
Main.fx.
After a quick overview of JavaFX Script's background, we'll embark on a script-driven tour of its basic language features, including variable declarations, fundamental types, and expressions. Once you've got the basics under your sombrero, we'll advance to the next level of JavaFX Scripting, with a series of small programs that reveal how the language handles sequences, classes, and object literals. Finally, we'll discuss two advanced topics that could be challenging to Java beginners, and should be of interest to developers already using JavaFX Script; namely replace triggers and data binding.
The discussion in this article is based on the version of JavaFX Script found in JavaFX Preview SDK, which will differ somewhat from the version found in JavaFX SDK 1.0. What you learn here will serve as background for Jeff's first look at JavaFX SDK 1.0, in the final two articles of this series.
While not definitive, this guide to JavaFX Script does fill some holes in the current documentation, and should be code-driven enough to keep you engaged and learning from start to finish. Note that you need not know a thing about JavaFX Script to learn from this guide; you should, however, be familiar with the Java language and object-oriented programming concepts. Note, also, that what you learn in this article about JavaFX Script's syntax (primarily) will be enriched in Part 3, when we look at the JavaFX APIs.
Just a little more than two years ago, Sun developer Chris Oliver introduced a project called F3 (Form Follows Function) via his blog. The project consisted of the F3 language and several APIs for simplifying GUI programming.
According to Oliver, F3 was "a declarative Java scripting language with static typing," which he said would provide IDE support and compile-time error reporting -- two features not found in JavaScript. The language also offered type-inference, declarative syntax, and automatic data-binding, with, as Oliver said "full support for 2D graphics and standard Swing components as well as declarative animation." Perhaps the biggest upside of using F3, according to its creator, was the ease with which it would allow developers to "import Java classes, create new Java objects, call their methods, and implement Java interfaces."