JavaFX Script

From Wikipedia, the free encyclopedia

JavaFX Script
Image:JavaFXCup200x230.png
Developed by Sun Microsystems
Latest release Alpha
OS Cross-platform
Genre Scripting language
License GNU General Public License
Website JavaFX Script Website

JavaFX Script is a scripting language designed by Sun Microsystems, forming part of the JavaFX family of technologies on the Java Platform. JavaFX targets the Rich Internet Application domain (competing with Adobe Flex and Microsoft Silverlight), specializing in rapid development of visually rich applications for the desktop and mobile markets. JavaFX Script works with integrated development environments like NetBeans and Eclipse. JavaFX is released under the GNU General Public License, via the Sun sponsored OpenJFX project,

Contents

[edit] 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 at JavaOne 2007.

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

[edit] 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. Because it is built on top of the Java Platform, it is easy to use any Java class 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 declarative syntax for constructing user interfaces contrasts sharply with the more verbose series of method calls required to construct an equivalent interface in Swing directly.

[edit] Examples

Here is a simple Hello world program for JavaFX Script :

Frame {
   title: "Hello World F3"
   width: 200
   content: Label {
      text: "Hello World"
   }
   visible: true
}

It shows the following panel :

This program can also be written in this way:

var win = new Frame();
win.title = "Hello World F3";
win.width = 200;
var label = new Label();
label.text = "Hello World";
win.content = label;
win.visible = true;

[edit] Prerequisites

All you need is a Java SE 5 or Java SE 6 for the support to JavaFX Scripting development. You can start developing your first application on JavaFX with your Eclipse or NetBeans 5.5 or later IDEs and by incorporating the necessary plugins for them.

[edit] References

  1. ^ JavaFX FAQ

[edit] Books

  • James, L. Weaver (October 29). JavaFX Script: Dynamic Java Scripting for Rich Internet/Client-side Applications, First Edition, ISBN 978-1590599457, Apress. 

[edit] See also

[edit] External links

Languages