Jump to content

JavaFX Script: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Yobot (talk | contribs)
m WP:CHECKWIKI error fixes + genfixes using AWB (7194)
JavaKid (talk | contribs)
Line 24: Line 24:
All the code, documentation and demos are shared in the [https://openjfx.dev.java.net/ Project OpenJFX] Development Website. JavaFX 1.0 was released on December 4, 2008<ref>[http://www.sun.com/aboutsun/pr/2008-12/sunflash.20081204.1.xml JavaFX 1.0 released]</ref>.
All the code, documentation and demos are shared in the [https://openjfx.dev.java.net/ Project OpenJFX] Development Website. JavaFX 1.0 was released on December 4, 2008<ref>[http://www.sun.com/aboutsun/pr/2008-12/sunflash.20081204.1.xml JavaFX 1.0 released]</ref>.


On September, 10 2010 Oracle announced at [[JavaOne]] that JavaFX Script would be discontinued, although the JavaFX API would be made available to other languages for the Java Virtual Machine.<ref>[http://www.h-online.com/open/news/item/JavaFX-Script-is-dead-long-live-JavaFX-1082823.html JavaFX Script is dead, long live JavaFX]</ref>.
On September, 10 2010 Oracle announced at [[JavaOne]] that JavaFX Script would be discontinued, although the JavaFX API would be made available to other languages for the Java Virtual Machine.<ref>[http://javafx.com/roadmap/ JavaFX 2010-2011 Roadmap]</ref>.


== Features ==
== Features ==

Revision as of 13:53, 5 October 2010

JavaFX
File:JavaFX logo.jpg
DeveloperSun Microsystems
Stable release
1.2 / June 2, 2009 (2009-06-02)
PlatformJava Runtime Environment
OSCross-platform
LicenseGPL
Websitehttp://javafx.com/

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 such as NetBeans and Eclipse. JavaFX is released under the GNU General Public License, via the Sun sponsored OpenJFX project.

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.

All the code, documentation and demos are shared in the Project OpenJFX Development Website. JavaFX 1.0 was released on December 4, 2008[1].

On September, 10 2010 Oracle announced at JavaOne that JavaFX Script would be discontinued, although the JavaFX API would be made available to other languages for the Java Virtual Machine.[2].

Features

JavaFX Script is a compiled, statically typed, declarative, scripting language for the Java Platform. It provides automatic data-binding, mutation triggers and declarative animation, using an expression language syntax (all code blocks potentially yield values.)

Through its standard JavaFX APIs it supports retained mode vector graphics, video playback and standard Swing components.

Although F3 began life as an interpreted language, prior to the first preview release (Q3 2008) JavaFX Script had shifted focus to being predominantly compiled. Interpreted JavaFX Script is still possible, via the JSR 223 'Scripting for Java' bridge. Because it is built on top of the Java Platform, it is easy to use Java classes in JavaFX Script code. Compiled JavaFX Script is able to run on any platform which has a recent Java Runtime installed.

Syntax

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.

Here is a simple Hello world program for JavaFX Script :

import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.text.Text;
import javafx.scene.text.Font;
Stage {
    title: "Hello World"
    width: 250
    height: 80
    scene: Scene {
        content: Text {
            font : Font {
                size : 24
            }
            x: 10, y: 30
            content: "Hello World"
        }
    } 
}

It shows the following window/frame :

This program can also be written in this way:

import javafx.ext.swing.*;
var myFrame:SwingFrame = new SwingFrame();
var myLabel:Label = new Label();
myLabel.text = "Hello World!";
myFrame.width = 200;
myFrame.height = 50;
myFrame.visible = true;
myFrame.content = myLabel;

Prerequisites

Java SE 5 or Java SE 6 is required to support JavaFX Script development. Developers may work with JavaFX Script using the Eclipse or NetBeans IDEs by incorporating the necessary plugins.

See also

References

Bibliography

  • Morris, Simon (November 23, 2009), JavaFX in Action, Manning, p. 375, ISBN 1933988991
  • Topley, Kim (October 12, 2009), JavaFX Developer's Guide, Addison-Wesley Professional, p. 640, ISBN 0321601653
  • Weaver, James L.; Gao, Weiqi; Chin, Stephen; Iverson, Dean (June 22, 2009), Pro JavaFX Platform: Script, Desktop and Mobile RIA with Java Technology, Apress, p. 500, ISBN 1430218754
  • Clarke, Jim; Connors, Jim; J. Bruno, Eric (June 15, 2009), JavaFX: Developing Rich Internet Applications, Prentice Hall, p. 384, ISBN 013701287X
  • Anderson, Gail; Anderson, Paul (June 15, 2009), Essential JavaFX, Prentice Hall, p. 360, ISBN 0137042795
  • Weaver, James L. (May 4, 2009), JavaFX Script: Dynamic Java Scripting for Rich Internet/Client-side Applications, Apress, p. 200, ISBN 1590599454