JavaFX Script was a
scripting language
A scripting language or script language is a programming language that is used to manipulate, customize, and automate the facilities of an existing system. Scripting languages are usually interpreted at runtime rather than compiled.
A scripti ...
designed by
Sun Microsystems
Sun Microsystems, Inc. (Sun for short) was an American technology company that sold computers, computer components, software, and information technology services and created the Java programming language, the Solaris operating system, ZFS, ...
, forming part of the
JavaFX
JavaFX is a software platform for creating and delivering desktop applications, as well as rich web applications that can run across a wide variety of devices. JavaFX has support for desktop computers and web browsers on Microsoft Windows, L ...
family of technologies on the
Java Platform
Java is a set of computer software and specifications developed by James Gosling at Sun Microsystems, which was later acquired by the Oracle Corporation, that provides a system for developing application software and deploying it in a cro ...
.
JavaFX targeted the
Rich Internet Application
A rich web application (originally called a rich Internet application, or RIA or installable Internet application) is a web application that has many of the characteristics of desktop application software. The concept is closely related to a sin ...
domain (competing with
Adobe Flex
Apache Flex, formerly Adobe Flex, is a software development kit (SDK) for the development and deployment of cross-platform rich web applications based on the Adobe Flash platform. Initially developed by Macromedia and then acquired by Adobe Sy ...
and
Microsoft Silverlight
Microsoft Silverlight is a discontinued application framework designed for writing and running rich web applications, similar to Adobe Inc., Adobe's Run time environment, runtime, Adobe Flash. A plugin for Silverlight is still available for a v ...
), specializing in rapid development of visually rich applications for the desktop and mobile markets. JavaFX Script works with
integrated development environment
An integrated development environment (IDE) is a software application that provides comprehensive facilities to computer programmers for software development. An IDE normally consists of at least a source code editor, build automation tools a ...
s such as
NetBeans
NetBeans is an integrated development environment (IDE) for Java. NetBeans allows applications to be developed from a set of modular software components called ''modules''. NetBeans runs on Windows, macOS, Linux and Solaris. In addition to Java ...
,
Eclipse
An eclipse is an astronomical event that occurs when an astronomical object or spacecraft is temporarily obscured, by passing into the shadow of another body or by having another body pass between it and the viewer. This alignment of three ce ...
and
IntelliJ IDEA
IntelliJ IDEA is an integrated development environment (IDE) written in Java for developing computer software written in Java, Kotlin, Groovy, and other JVM-based languages. It is developed by JetBrains (formerly known as IntelliJ) and is a ...
. JavaFX is released under the
GNU General Public License
The GNU General Public License (GNU GPL or simply GPL) is a series of widely used free software licenses that guarantee end user
In product development, an end user (sometimes end-user) is a person who ultimately uses or is intended to ulti ...
, 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
The Sun is the star at the center of the Solar System. It is a nearly perfect ball of hot plasma, heated to incandescence by nuclear fusion reactions in its core. The Sun radiates this energy mainly as light, ultraviolet, and infrared rad ...
employee through their acquisition of
SeeBeyond Technology Corporation
Sun Microsystems, Inc. (Sun for short) was an American technology company that sold computers, computer components, software, and information technology services and created the Java programming language, the Solaris operating system, ZFS, t ...
in September 2005.
Its name was changed to JavaFX Script, and it became
open source
Open source is source code that is made freely available for possible modification and redistribution. Products include permission to use the source code, design documents, or content of the product. The open-source model is a decentralized sof ...
d at
JavaOne
__NOTOC__
JavaOne is an annual conference first organized in 1996 by Sun Microsystems to discuss Java technologies, primarily among Java developers. It was held in San Francisco, California, typically running from a Monday to Thursday in summer m ...
2007.
JavaFX 1.0 was released on December 4, 2008. On September 10, 2010 Oracle announced at
JavaOne
__NOTOC__
JavaOne is an annual conference first organized in 1996 by Sun Microsystems to discuss Java technologies, primarily among Java developers. It was held in San Francisco, California, typically running from a Monday to Thursday in summer m ...
that JavaFX Script would be discontinued, although the JavaFX API would be made available to other languages for the Java Virtual Machine.
On September 27, 2010 Stephen Chin announced Visage a declarative user-interface language based on the JavaFX Script with enhancements.
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.
Features
JavaFX Script was a compiled,
statically typed
In computer programming, a type system is a logical system comprising a set of rules that assigns a property called a type to every "term" (a word, phrase, or other set of symbols). Usually the terms are various constructs of a computer program ...
,
declarative scripting language
A scripting language or script language is a programming language that is used to manipulate, customize, and automate the facilities of an existing system. Scripting languages are usually interpreted at runtime rather than compiled.
A scripti ...
for the
Java Platform
Java is a set of computer software and specifications developed by James Gosling at Sun Microsystems, which was later acquired by the Oracle Corporation, that provides a system for developing application software and deploying it in a cro ...
. It provided automatic data-binding,
mutation triggers and
declarative animation
Declarative may refer to:
* Declarative learning, acquiring information that one can speak about
* Declarative memory, one of two types of long term human memory
* Declarative programming, a computer programming paradigm
* Declarative sentence
I ...
, using an expression language syntax (all code blocks potentially yield values.)
Through its standard
JavaFX
JavaFX is a software platform for creating and delivering desktop applications, as well as rich web applications that can run across a wide variety of devices. JavaFX has support for desktop computers and web browsers on Microsoft Windows, L ...
APIs it supported
retained mode
Retained mode in computer graphics is a major pattern of API design in graphics libraries, in which
* the graphics library, instead of the client, retains the scene (complete object model of the rendering primitives) to be rendered and
* the ...
vector graphics, video playback and standard
Swing
Swing or swinging may refer to:
Apparatus
* Swing (seat), a hanging seat that swings back and forth
* Pendulum, an object that swings
* Russian swing, a swing-like circus apparatus
* Sex swing, a type of harness for sexual intercourse
* Swing rid ...
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
Java is a set of computer software and specifications developed by James Gosling at Sun Microsystems, which was later acquired by the Oracle Corporation, that provides a system for developing application software and deploying it in a cro ...
, it is easy to use
Java
Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's mo ...
classes in JavaFX Script code. Compiled JavaFX Script was able to run on any platform that has a recent
Java Runtime
A Java virtual machine (JVM) is a virtual machine that enables a computer to run Java programs as well as programs written in other languages that are also compiled to Java bytecode. The JVM is detailed by a specification that formally describes ...
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
''Hello'' is a salutation or greeting in the English language. It is first attested in writing from 1826. Early uses
''Hello'', with that spelling, was used in publications in the U.S. as early as the 18 October 1826 edition of the '' Norwich ...
for JavaFX Script :
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.text.Text;
import javafx.scene.text.Font;
Stage
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
Java applets were small applications written in the Java programming language, or another programming language that compiles to Java bytecode, and delivered to users in the form of Java bytecode. The user launched the Java applet from a ...
, a means of deploying Java applications inside a web page.
*
JavaFX
JavaFX is a software platform for creating and delivering desktop applications, as well as rich web applications that can run across a wide variety of devices. JavaFX has support for desktop computers and web browsers on Microsoft Windows, L ...
, a family of products and technologies intended to be used to create
Rich Internet Applications (RIAs).
*
Swing
Swing or swinging may refer to:
Apparatus
* Swing (seat), a hanging seat that swings back and forth
* Pendulum, an object that swings
* Russian swing, a swing-like circus apparatus
* Sex swing, a type of harness for sexual intercourse
* Swing rid ...
, the underlying user interface library employed by JavaFX Script.
*
Curl (programming language)
Curl is a reflective object-oriented programming language for interactive web applications whose goal is to provide a smoother transition between formatting and programming. It makes it possible to embed complex objects in simple documents witho ...
, also with a declarative mode with optional typing
References
Bibliography
*
*
*
*
*
*
External links
JavaFX Main Site
Sun's JavaFX overviewChris Oliver's blog, F3 categoryJames Weaver's Learn JavaFX WeblogSun.com - Learning JavaFX Script: An Introduction for Java Programmers(
New York Times
''The New York Times'' (''the Times'', ''NYT'', or the Gray Lady) is a daily newspaper based in New York City with a worldwide readership reported in 2020 to comprise a declining 840,000 paid print subscribers, and a growing 6 million paid ...
article)
* (
CNET article)
Planet JFX Community Wiki(how-to's, code samples, tutorials)
{{DEFAULTSORT:JavaFX Script
Declarative programming languages
Java programming language family
JVM programming languages
Scripting languages