Est. 2008 Intermediate

JavaFX

A modern Java toolkit for building rich graphical desktop, web, and mobile applications, combining a declarative FXML/CSS UI layer with a hardware-accelerated scene graph.

Created by Sun Microsystems (Chris Oliver)

Paradigm Object-oriented, Declarative, Event-driven
Typing Static, Strong
First Appeared 2008
Latest Version JavaFX 26 (2026)

JavaFX is a software platform and Java client toolkit for building rich graphical user interfaces that run on desktop, web, and mobile devices. First released by Sun Microsystems as JavaFX 1.0 in December 2008, it was conceived as the next-generation successor to Swing and the Abstract Window Toolkit (AWT) for Java desktop development. Modern JavaFX combines a declarative UI layer – an XML markup language called FXML together with CSS for styling – with a retained-mode scene graph rendered through a hardware-accelerated graphics pipeline. Although it began as a dedicated scripting language, today JavaFX is a set of Java libraries (now developed in the open as the OpenJFX project) used from Java and other JVM languages such as Kotlin, Scala, and Groovy.

History & Origins

From F3 to JavaFX Script

JavaFX traces its lineage to a project called F3 (“Form Follows Function”), a declarative scripting language for building graphical user interfaces created primarily by Chris Oliver. Oliver joined Sun Microsystems through its acquisition of SeeBeyond Technology Corporation in 2005. Sun saw in F3 an answer to the rise of rich Internet application platforms such as Adobe Flash/Flex and Microsoft Silverlight, which were eroding Java’s relevance on the client side.

Sun publicly announced JavaFX at the JavaOne conference in May 2007, renaming F3 to JavaFX Script and open-sourcing it. JavaFX Script was a statically typed declarative language with first-class support for data binding, animation, and a scene-graph model – designed to make visually compelling UIs far more concise than the equivalent Swing code.

The 1.x Era (2008-2010)

JavaFX 1.0 was released on December 4, 2008, accompanied by a runtime, tooling, and a NetBeans plugin. Rapid follow-up releases extended its reach: JavaFX 1.1 (“Franca”, February 2009) added mobile support; JavaFX 1.2 (“Marina”, June 2009) brought new controls and beta support for Linux and Solaris; and JavaFX 1.3 (“Soma”, April 2010) focused on performance. During this period, Oracle completed its acquisition of Sun Microsystems (early 2010), inheriting stewardship of the platform.

The 2.0 Rewrite (2011)

The 1.x line never achieved the adoption Sun had hoped for, and the separate JavaFX Script language proved a barrier: developers had to learn a new language, and integration with existing Java code was awkward. In a decisive change of direction, Oracle released JavaFX 2.0 (“Presidio”) in October 2011 as a complete rewrite. JavaFX Script was abandoned, and JavaFX was reborn as a pure Java API – a set of libraries that could be called from ordinary Java code (or any JVM language). The declarative spirit of JavaFX Script was preserved in two complementary technologies introduced around this time: FXML, an XML-based markup language for describing UIs, and CSS styling of UI controls. The JavaFX Script language itself lived on briefly as the community-driven Visage project, which ended around 2013.

Integration with the JDK and the Move to OpenJFX

JavaFX 8 shipped bundled with JDK 8 in March 2014, the moment Oracle positioned JavaFX as the official replacement for Swing. This release added 3D graphics, the modern “Modena” default theme, and a richer set of controls. JavaFX remained part of the Oracle JDK and the OpenJDK builds through the Java 8/9/10 era.

In 2018, Oracle changed course again: beginning with JavaFX 11 (September 2018), JavaFX was decoupled from the JDK and released as a standalone, independently versioned module set. Development moved fully into the open under the OpenJFX project, and the company Gluon took on the role of producing standalone JavaFX builds for desktop and mobile platforms. This separation let JavaFX evolve on its own schedule, aligned with each Java release.

Design Philosophy

Declarative UI over Imperative Code

JavaFX’s central idea is to separate what a UI looks like from how it behaves. FXML lets designers and developers describe the structure of an interface declaratively, while application logic lives in Java controller classes. CSS handles appearance. This separation echoes the web’s HTML/CSS/JavaScript division of responsibilities and was a deliberate departure from Swing, where layout, styling, and behavior were all expressed imperatively in Java.

The Scene Graph

At the heart of JavaFX is a scene graph: a tree of nodes representing every visual element – shapes, controls, images, text, and media. This retained-mode model contrasts with the immediate-mode painting of AWT/Swing. Because the framework retains a structured description of the UI, it can apply transformations, effects, animations, and hardware-accelerated rendering to nodes efficiently.

Properties and Binding

JavaFX introduced a first-class observable properties and bindings API. Properties can be observed for changes, and bindings let one value automatically track another – for example, keeping a label’s text synchronized with a model field, or a node’s width tied to its container. This reactive model is one of JavaFX’s most distinctive contributions and remains widely admired.

Key Features

FXML and Scene Builder

FXML is an XML dialect for laying out JavaFX scene graphs without writing Java code:

1
2
3
4
5
<VBox xmlns:fx="http://javafx.com/fxml" fx:controller="com.example.LoginController">
    <Label text="Username:"/>
    <TextField fx:id="usernameField"/>
    <Button text="Sign In" onAction="#handleSignIn"/>
</VBox>

Scene Builder, originally created by Oracle and now maintained by Gluon, is a visual drag-and-drop designer that generates and edits FXML, letting developers compose interfaces without hand-writing markup.

CSS Styling

JavaFX controls are styled with CSS, using a property syntax prefixed with -fx-:

1
2
3
4
5
6
.button {
    -fx-background-color: #2d7d46;
    -fx-text-fill: white;
    -fx-font-size: 14px;
    -fx-background-radius: 6;
}

This makes it possible to re-theme an entire application without touching its Java code.

Properties and Bindings in Code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
TextField celsius = new TextField();
Label fahrenheit = new Label();

fahrenheit.textProperty().bind(
    Bindings.createStringBinding(
        () -> {
            try {
                double c = Double.parseDouble(celsius.getText());
                return String.format("%.1f °F", c * 9 / 5 + 32);
            } catch (NumberFormatException e) {
                return "";
            }
        },
        celsius.textProperty()
    )
);

A Rich Control Set, Media, and WebView

JavaFX ships an extensive library of UI controls (tables, tree views, charts, date pickers, and more), a built-in charts package, a media engine for audio and video playback, and WebView – an embeddable web browser component built on WebKit that can render HTML and run JavaScript inside a JavaFX application.

Hardware-Accelerated Rendering

JavaFX’s graphics stack is layered. The Prism rendering engine draws the scene graph using hardware acceleration where available (Direct3D on Windows, OpenGL on other platforms), falling back to software rendering otherwise. The Glass windowing toolkit provides native windows and input handling, while the Quantum Toolkit ties rendering and windowing together with the JavaFX threading model. Recent JavaFX releases (around JavaFX 26, 2026) reportedly added a Metal rendering pipeline for macOS, replacing the aging OpenGL backend on Apple hardware.

Modular Architecture

Since JavaFX 11, the platform is delivered as a set of Java Platform Module System modules, including javafx.base, javafx.graphics, javafx.controls, javafx.fxml, javafx.media, and javafx.web. Applications declare only the modules they need.

Evolution

EraReleasesDefining change
1.x (2008-2010)1.0 – 1.3Declarative JavaFX Script language for rich client UIs
2.x (2011-2012)2.0 – 2.2Rewritten as a pure Java API; FXML, CSS, native packaging
8 (2014)JavaFX 8Bundled with JDK 8 as the Swing successor; 3D, Modena theme
11+ (2018-)11, 17, 21, 24, 25, 26Decoupled from the JDK, developed in the open as OpenJFX, released by Gluon

The post-2018 releases follow Java’s six-month cadence, with periodic long-term support versions (such as JavaFX 21) maintained for production users. Recent work has focused on rendering modernization (the macOS Metal pipeline), high-DPI improvements, and prototypes such as a headless platform for running JavaFX in environments without a display, including containers and CI runners.

Current Relevance

JavaFX occupies a focused but durable niche: it is one of the principal options for building cross-platform desktop applications in the Java ecosystem, alongside the older Swing/AWT stack and Eclipse’s SWT. Its open development under OpenJFX, its independent release schedule, and Gluon’s commercial support keep it actively maintained. The combination of FXML, CSS, and the property-binding model makes it attractive for data-driven business and scientific desktop tools, and projects such as JabRef, Cryptomator, and the BlueJ/Greenfoot educational IDEs demonstrate continued real-world use.

JavaFX also reaches beyond the desktop. Through Gluon’s tooling and GraalVM ahead-of-time compilation, JavaFX applications can target iOS and Android, and the WebView component lets applications embed web content. While it never displaced web technologies or native mobile toolkits for mainstream consumer apps, JavaFX remains a capable, modern choice where a rich Java desktop client is the right tool.

Why It Matters

JavaFX represents Java’s most ambitious attempt to stay relevant on the client side after the decline of applets and the limitations of Swing. Its history – a bold scripting-language bet, a pragmatic rewrite into plain Java, integration into and then separation from the JDK – mirrors the broader story of how the Java platform adapts to changing realities. Along the way it contributed lasting ideas: a clean separation of UI structure (FXML), style (CSS), and behavior (Java); a retained-mode scene graph with hardware-accelerated rendering; and an elegant observable-properties-and-bindings model that influenced reactive UI thinking on the JVM, including frameworks such as TornadoFX for Kotlin. For developers who need a polished, themeable, cross-platform desktop application in Java, JavaFX remains the platform’s flagship answer.

Timeline

2007
Sun Microsystems announces JavaFX at the JavaOne conference in May 2007; the JavaFX Script language (descended from Chris Oliver's 'F3' project) is open-sourced
2008
JavaFX 1.0 released on December 4, 2008, built around the declarative JavaFX Script language for rich Internet and desktop UIs
2009
JavaFX 1.1 ('Franca') adds mobile support in February, followed by JavaFX 1.2 ('Marina') in June
2010
JavaFX 1.3 ('Soma') released in April with performance improvements; Oracle completes its acquisition of Sun Microsystems and inherits JavaFX
2011
JavaFX 2.0 ('Presidio') released in October -- a major rewrite that abandons JavaFX Script in favor of a pure Java API callable from any JVM language
2012
JavaFX 2.2 released in August, adding Linux support and native application packaging; Scene Builder, a visual FXML layout tool, is introduced
2014
JavaFX 8 ships bundled with JDK 8 in March, becoming the official successor to Swing and adding 3D graphics, the Modena theme, and built-in controls
2018
Starting with JavaFX 11 (September 2018), Oracle decouples JavaFX from the JDK and develops it in the open under the OpenJFX project; Gluon takes over standalone releases for desktop, iOS, and Android
2023
JavaFX 21 released in September alongside JDK 21; Gluon offers it as a long-term support (LTS) release, providing extended maintenance for production applications
2026
JavaFX 26 released in March; recent releases reportedly introduce a macOS Metal rendering pipeline (replacing OpenGL on Apple hardware) and a prototype headless platform for running without a display

Notable Uses & Legacy

Gluon Scene Builder

A free, open-source visual drag-and-drop tool for designing JavaFX user interfaces, itself written in JavaFX. Maintained by Gluon, it has reportedly surpassed two million downloads and produces FXML layouts consumed at runtime.

BlueJ and Greenfoot

Educational Java IDEs developed by an academic group now based at King's College London (originating at the University of Kent). BlueJ migrated its interface to JavaFX, using the toolkit to deliver an interactive object-oriented learning environment used in classrooms worldwide.

JabRef

An open-source bibliography and reference manager for BibTeX. JabRef rebuilt its desktop interface on JavaFX, taking advantage of FXML, CSS styling, and the property-binding model.

Cryptomator

An open-source client-side encryption tool for cloud storage. Its desktop application uses JavaFX for a cross-platform interface across Windows, macOS, and Linux.

Gluon Mobile

A commercial framework from Gluon that brings JavaFX to iOS and Android, enabling a single JavaFX codebase to target desktop and mobile platforms through ahead-of-time compilation with GraalVM.

Language Influence

Influenced By

JavaFX Script Swing Java CSS

Influenced

TornadoFX

Running Today

Run examples using the official Docker image:

docker pull
Last updated: