JavaFX Script

This is an old revision of this page, as edited by 198.87.131.60 (talk) at 01:57, 15 May 2007. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

JavaFX Script is a scripting language designed by Sun Microsystems built on the Java Platform. 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.

JavaFX Script
Developer(s)Sun Microsystems
Stable release
Alpha
Operating systemCross-platform
TypeScripting language
LicenseGPL
WebsiteJavaFX Website

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.

It is currently in alpha stage [1], and all the code, documentation and demos are shared in the Project OpenJFX Development Website.

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 interpreter generates default Java bytecode. A compiler is planned for the future that will improve performance by compiling JavaFX directly into 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;

Notes

See also