JavaFX Script

Source: Wikipedia, the free encyclopedia.
JavaFX
Developer
Sun Microsystems
Stable release
1.2 / June 2, 2009 (2009-06-02)
Cross-platform
LicenseGPL
Websitehttp://javafx.com/

JavaFX Script was a

Java Platform
.

JavaFX targeted the

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, Eclipse and IntelliJ IDEA. 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

SeeBeyond Technology Corporation
in September 2005.

Its name was changed to JavaFX Script, and it became open sourced at JavaOne 2007.

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]

On September 27, 2010 Stephen Chin announced Visage a declarative user-interface language based on the JavaFX Script with enhancements.[3]

On April 8, 2012 a project was created with the intention of resurrecting and enhancing the original F3 programming language, but the project appears to have been discontinued in August 2015.[4]

Features

JavaFX Script was a compiled,

Java Platform. It provided 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 supported 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

Java Runtime
installed.

Syntax

JavaFX Script's declarative style for constructing user interfaces can provide shorter and more readable source code than the more verbose series of method calls required to construct an equivalent interface if written in JavaFX Script's procedural style.

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 JavaFX Script using a procedural style this way:

 import javafx.stage.Stage;
 import javafx.scene.Scene;
 import javafx.scene.text.Text;
 import javafx.scene.text.Font;

 javafx.scene.text.Font".
 var myFont:Font = Font.font(null, 24);

 var myText:Text = new Text();
 myText.font = myFont;
 myText.x = 10;
 myText.y = 30;
 myText.content = "Hello World";

 var myScene:Scene = new Scene();
 myScene.content = myText;

 var myStage:Stage = new Stage();
 myStage.title = "Hello World";
 myStage.width = 250;
 myStage.height = 80;
 myStage.scene = myScene;

See also

  • Java applet, a means of deploying Java applications inside a web page.
  • Rich Internet Applications (RIAs)
    .
  • Swing, the underlying user interface library employed by JavaFX Script.
  • Curl (programming language), also with a declarative mode with optional typing

References

  1. ^ JavaFX 1.0 released
  2. ^ JavaFX 2010-2011 Roadmap Archived 2010-10-29 at the Wayback Machine
  3. ^ "Steve On Java » Announcing Visage – The DSL for Writing UIs". steveonjava.com. Archived from the original on 2010-10-01.
  4. ^ unktomi (2022-07-31), unktomi/form-follows-function, retrieved 2023-03-30

Bibliography

External links