So far in this blog I've been showing you:
- How to write your first JavaFX Script program, and understand many of the concepts contained in it.
- How to use resources such as JavaFXPad and the Project OpenJFX download to develop and execute JavaFX programs.
- How to use simple declarative scripting to, among other things, leverage the power of Java Swing components.
- How to bind the UI (view) to the data (model).
- Examples of non-trivial JavaFX Script applications such as the Freebase Browser and the Word Search Puzzle Builder.
- My plans as a CTO for utilizing JavaFX Script within our company (LAT, Inc.)
- How to use the powerful layout widgets to help create user interfaces for a cross-platform environment
- Some of the 2D graphical features of JavaFX Script
- A few of the fundamentals of the JavaFX Script language, such as defining classes, attributes and triggers.
However, there are several JavaFX Script language fundamentals that I haven't covered in much detail, such as sequences (arrays). At this point, I'd like to introduce you to a great tutorial created by Robert Eckstein and others at Sun that covers the fundamentals of the JavaFX Script language. Parts of the tutorial will be an excellent review for you as well. I highly recommend taking this tutorial, and besides, future JavaFX Puzzlers in this blog will assume that you did :-D
Enjoy!
Jim Weaver
JavaFX Script: Dynamic Java Scripting for Rich Internet/Client-side Applications
Good points, codecraig! Thanks for your input!
Posted by: James Weaver | November 12, 2007 at 09:27 AM
JavaFX Script does offer some interesting methods of querying and modifying arrays. I think the SQL-esque features are especially interesting:
import java.lang.System;
var x = [1..10];
foreach (i in x where i % 2 == 0)
System.out.println(i);
This example demonstrates a few things. First it uses a range to create a list of numbers from 1 through 10. Then I used the built-in foreach operator to iterate over the "x" list. In the foreach block I used some of the SQL-esque features such as "where i % 2 == 0" to print only the even numbers.
JavaFX Script is really interesting and has lots of goodies that I have yet to fool around with.
Posted by: codecraig | November 11, 2007 at 09:49 PM