JavaFX Script
title: "JavaFX Script" type: doc version: 1 created: 2026-02-28 author: "Wikipedia contributors" status: active scope: public tags: ["declarative-programming-languages", "java-programming-language-family", "jvm-programming-languages", "scripting-languages"] topic_path: "technology/programming-languages" source: "https://en.wikipedia.org/wiki/JavaFX_Script" license: "CC BY-SA 4.0" wikipedia_page_id: 0 wikipedia_revision_id: 0
::data[format=table title="Infobox programming language"]
| Field | Value |
|---|---|
| name | JavaFX |
| logo | JavaFX Logo.png |
| logo size | 220px |
| developer | Sun Microsystems |
| latest release version | 1.2 |
| latest release date | |
| platform | Java Runtime Environment |
| operating_system | Cross-platform |
| license | GPL |
| website | http://javafx.com/ |
| :: |
| name = JavaFX | logo = JavaFX Logo.png | logo size = 220px | developer = Sun Microsystems | latest release version = 1.2 | latest release date = | latest preview version = | latest preview date = | platform = Java Runtime Environment | operating_system = Cross-platform | license = GPL | website = http://javafx.com/
JavaFX Script was a scripting language designed by Sun Microsystems, forming part of the JavaFX family of technologies on the Java Platform.
JavaFX targeted 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, 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 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.
JavaFX 1.0 was released on December 4, 2008. 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.
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, declarative scripting language for the 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 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 was able to run on any platform that has a recent 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: ::code[lang=java] 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 :
::figure[src="https://upload.wikimedia.org/wikipedia/commons/6/63/HelloWorld_Java_FX.jpg"] ::
This program can also be written in JavaFX Script using a procedural style this way: ::code[lang=java] import javafx.stage.Stage; import javafx.scene.Scene; import javafx.scene.text.Text; import 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; ::
References
Bibliography
- {{citation | first1 = Simon | last1 = Morris | date = November 23, 2009 | title = JavaFX in Action | publisher = Manning | pages = 375 | isbn = 978-1-933988-99-3 | url =
- {{citation |first1 = Kim |last1 = Topley |date = October 12, 2009 |title = JavaFX Developer's Guide |publisher = Addison-Wesley Professional |pages = 640 |isbn = 978-0-321-60165-0 |url = http://www.informit.com/store/product.aspx?isbn=0321648978
- {{citation |first1 = James L. |last1 = Weaver |first2 = Weiqi |last2 = Gao |first3 = Stephen |last3 = Chin |first4 = Dean |last4 = Iverson |date = June 22, 2009 |title = Pro JavaFX Platform: Script, Desktop and Mobile RIA with Java Technology |publisher = Apress |pages = 500 |isbn = 978-1-4302-1875-3 |url = http://www.apress.com/book/view/1430218754 |access-date = August 2, 2009 |archive-date = August 15, 2009 |archive-url = https://web.archive.org/web/20090815082457/http://apress.com/book/view/1430218754 |url-status = dead
- {{citation |first1 = Jim |last1 = Clarke |first2 = Jim |last2 = Connors |first3 = Eric |last3 = J. Bruno |date = June 15, 2009 |title = JavaFX: Developing Rich Internet Applications |publisher = Prentice Hall |pages = 384 |isbn = 978-0-13-701287-9 |url = http://www.informit.com/store/product.aspx?isbn=0137013531
- {{citation |first1 = Gail |last1 = Anderson |first2 = Paul |last2 = Anderson |date = June 15, 2009 |title = Essential JavaFX |publisher = Prentice Hall |pages = 360 |isbn = 978-0-13-704279-1 |url = http://www.informit.com/store/product.aspx?isbn=0137042795
- {{citation | first = James L. | last = Weaver | date = May 4, 2009 | title = JavaFX Script: Dynamic Java Scripting for Rich Internet/Client-side Applications | publisher = Apress | pages = 200 | isbn = 978-1-59059-945-7 | url = http://www.apress.com/book/view/1590599454 | access-date = August 2, 2009 | archive-date = March 23, 2012 | archive-url = https://web.archive.org/web/20120323194640/http://www.apress.com/book/view/1590599454 | url-status = dead
References
- (2008-12-04). "Sun Microsystems Unveils JavaFX 1.0 with Immersive Media Capabilities Targeted at Market's 800 Million Java Powered Desktops".
- [http://javafx.com/roadmap/ JavaFX 2010-2011 Roadmap] {{webarchive. link. (2010-10-29)
- "Steve On Java » Announcing Visage – The DSL for Writing UIs".
- unktomi. (2022-07-31). "unktomi/form-follows-function".
::callout[type=info title="Wikipedia Source"] This article was imported from Wikipedia and is available under the Creative Commons Attribution-ShareAlike 4.0 License. Content has been adapted to SurfDoc format. Original contributors can be found on the article history page. ::