JavaFX Script is a scripting language designed by Sun Microsystems, working in the Java Platform and intended to be more productive and easier than Java. It is targeted for the same class of interactive web applications for which Adobe Flash, AJAX and Microsoft Silverlight are targeted. It works with major IDEs like NetBeans and Eclipse.
License
JavaFX is released under GNU General Public License (GPL).
History
JavaFX Script used to be called F3 for Form Follows Function. F3 was primarily developed by Chris Oliver, who became a Sun employee through their acquisition of SeeBeyond Technology Corporation in September 2005.
Its name was changed to JavaFX Script, and it became Open sourced on JavaOne 2007.
Features
JavaFX Script is a compiled statically typed declarative scripting language for the Java Platform providing automatic data-binding, full support for 2D graphics and standard Swing components as well as declarative animation. As it is built on top of the Java Platform, it is easy to use any Java classes in JavaFX scripts.
JavaFX is able to run on any platform which has the Java Runtime installed. No modifications are needed since the JavaFX compiler generates default Java bytecode.
JavaFX Script's syntax is more like Visual Basic - in that components are specified declaratively, and callbacks are linked via a bind operation. This contrasts strongly to Swing, which has a verbose syntax that is confronting to many experienced developers.
Examples
Here is a simple Hello world program for JavaFX Script :
Frame { title: "Hello World JavaFX" width: 200 content: Label { text: "Hello World" } visible: true }
It shows the following panel : File:F3 Hello World.png
This program can also be written in this way :
var win = new Frame(); win.title = "Hello World JavaFX"; win.width = 200; var label = new Label(); label.text = "Hello World"; win.content = label; win.visible = true;
See also
- JavaFX, a family of products and technologies intended to be used to create Rich Internet Applications (RIAs)
- [[Swing (Java)]|Swing]]