Jump to content

JavaFX

From Alfawiki
JavaFX
Company typeSoftware framework
IndustrySoftware development
PredecessorF3 project
FoundedMay 2007; 19 years ago (2007-05)
FounderChris Oliver (origin of scripting language component)
Headquarters
United States
Area served
Cross-platform (Microsoft Windows, Linux, macOS, iOS, Android)
ProductsJavaFX SDK, JavaFX Scene Builder, WebView component, JavaFX Mobile
OwnerOracle Corporation (since incorporation into OpenJDK in 2018)
Websiteopenjfx.io

JavaFX serves as a software framework designed for creating and deploying desktop alongside rich internet applications across a variety of platforms. It is compatible with Microsoft Windows, Linux (including Raspberry Pi), macOS, and mobile operating systems such as iOS and Android through Gluon Mobile.

Starting with the 2018 release of JDK 11, Oracle incorporated JavaFX into the OpenJDK under the OpenJFX initiative to speed up its evolution.

The open-source project JavaFXPorts expands functionality to iOS and Android devices. Gluon provides proprietary tools that enhance both mobile and desktop environments, facilitating a single codebase for applications spanning desktop, iOS, and Android.

Features

With the release of JavaFX 1.1, a "common profile" was introduced that encompasses all supported platforms, allowing developers to employ a consistent programming paradigm for desktop and mobile apps while sharing code, visual elements, and content. To better suit distinct device categories, JavaFX 1.1 offers APIs customized for either desktop or mobile usage; for example, the Desktop profile integrates Swing alongside sophisticated visual effects.

The "Drag-to-Install" capability enables users to drag a JavaFX widget from a web page directly onto their desktop, maintaining application state even after closing the browser. This process automatically creates a shortcut for quick relaunching. This feature builds upon the Java applet technology introduced in Java 6u10, presenting developers with an alternative distribution method beyond traditional browsers.

In the JavaFX 1.x era, plug-ins were available for Adobe Photoshop and Illustrator to embed advanced graphics into applications by converting artwork into JavaFX Script code that preserved layers and structure. Developers could then animate or apply effects to these graphics. Additionally, an SVG converter tool named Media Factory allowed importing and previewing graphics in the JavaFX format.

Prior to version 2.0, applications were authored using the statically typed, declarative JavaFX Script, which compiled into Java bytecode, enabling seamless integration with Java codebases. These applications were compatible with any desktop environment supporting Java SE. From version 2.0 onward, JavaFX transitioned into a Java library where applications are developed using standard Java syntax. Consequently, Oracle ceased development of JavaFX Script; it persisted briefly via the Visage project until 2013.

Sun Microsystems licensed the custom typeface Amble specifically for JavaFX devices. Designed by mobile UI expert Punchcut, this font was included in the JavaFX SDK 1.3 release.

WebView

WebView, an embedded web browser component within JavaFX, utilizes the WebKit browser engine. It supports core HTML5 features such as canvas elements, media tags, meter, progress indicators, details and summary elements, along with MathML, SVG graphics, JavaScript execution, and CSS styling. However, WebAssembly support is not activated.

JavaFX Mobile

JavaFX Mobile represented the variant of the JavaFX platform tailored for rich web applications on mobile devices. Applications built with JavaFX Mobile 1.x employed the same language (JavaFX Script) and development tools (JavaFX SDK and Production Suite) as desktop/browser-based JavaFX 1.x applications, enabling shared assets in code and graphics. Integration with Java ME granted access to device-specific features such as filesystem, camera functionality, GPS, bluetooth, and accelerometer sensors.

As an independent platform based on Java technology, JavaFX Mobile operated across several mobile operating systems including Android, Windows Mobile, and proprietary real-time operating systems.

Introduced publicly alongside JavaFX 1.1 by Sun Microsystems in February 2009, Sun’s strategy involved partnering with handset manufacturers and carriers to preload the JavaFX Mobile runtime on devices. Demonstrations showcased JavaFX Mobile running on Android at JavaOne 2008 conferences, accompanied by collaborations announced with companies like LG Electronics and Sony Ericsson during its 2009 launch.

Type Description Applications
Basic Matrix Heat Map A two-dimensional grid representing values through color coding; simple layout without clustering. Gene expression analysis, correlation matrices, fundamental statistics
Clustered Heat Map Organizes similar rows or columns via hierarchical clustering accompanied by dendrograms. Genomics research, customer segmentation strategies, biological network visualization
Annotated Heat Map Displays numeric labels within each cell alongside color gradations. Dashboard reporting tools, business intelligence platforms, healthcare data analysis
Geographic Heat Map Applies intensity overlays on maps based on regions or geographic coordinates. Crime mapping initiatives, election result visualization, population distribution studies
Point Density Heat Map Illustrates density derived from point events without defined regional boundaries. Epidemiology tracking, traffic flow analysis, hotspot identification
Interactive Heat Map Digital maps featuring zoom capabilities, filters, and tooltips for enhanced user interaction. Web usability testing, marketing analytics, behavioral monitoring
3D/Volumetric Heat Map Represents data in three dimensions or volumetric scans such as medical imaging. MRI data interpretation, neuroscience research visualization, CT scan assessments
Temporal (Calendar) Heat Map Arranges heat map data according to time intervals like calendar days or recurring patterns. Activity monitoring dashboards, GitHub commit tracking, sales performance analysis
Multivariate Heat Map Encodes several variables per cell using combinations of color, size, shape or annotations. Artificial intelligence explainability tools, genomics data visualization, complex dashboards
Correlogram Symmetric matrix illustrating pairwise correlations with color intensity indicating strength and sign. Economic studies, psychological research analyses, educational data exploration


Components

The JavaFX platform is composed of several essential elements:

  • The JavaFX SDK: which offers graphics rendering, media capabilities, advanced text libraries, and a web view component.
  • NetBeans IDE tailored for JavaFX: includes a drag-and-drop interface for adding elements with transformations, effects, and animations, along with samples and recommended practices. Eclipse users can access similar functionality through the e(fx)clipse community plugin.
  • JavaFX Scene Builder: introduced from version 2.1 onwards, this tool facilitates UI design by dragging controls from a palette and saving the interface layout as FXML files, a specialized XML format.

Post-version increment releases

Starting with Java 8 (released March 18, 2014), JavaFX was incorporated into the JRE/JDK, matching the versioning scheme as JavaFX 8.

Key enhancements in JavaFX 8 included:

  • Introduction of 3D graphics capabilities
  • Integration with various sensors
  • MathML support (added in Update 192)
  • Improvements to printing and rich text features
  • Replacement of JOptionPane with generic dialog templates (from JavaFX 8u40)

JavaFX 9 concentrated on modularizing UI Controls and CSS APIs under JEP 253.

From JDK 11 onwards, Oracle stopped bundling JavaFX within the JDK; instead, it became available as an independent module.

The initial standalone release, JavaFX 11, appeared in September 2018:

  • Current public version: JavaFX 11.0.2
  • Latest long-term support version: JavaFX 11.0.16
  • Added support for MathML and introduced the FX Robot API

Subsequent versions focused on refining platform features:

JavaFX 12 (March 2019):

  • Enabled mouse forward and backward button support
  • Introduced new subclassing approaches for VirtualFlow

JavaFX 13 (September 2019):

  • Added compatibility with e-paper displays
  • Implemented native media rendering using WritableImages backed by NIO ByteBuffers

JavaFX 14 (March 2020):

  • Introduced tab size property for Text and TextFlow elements
  • Enabled HTTP/2 support within WebView

JavaFX 15 (September 2020):

  • Expanded e-paper display functionality on i.MX6 hardware

JavaFX 16 (March 2021) and JavaFX 17 (September 2021) delivered:

  • A new SpotLight type for 3D lighting
  • Support for inline data-URI loading in images and stylesheets
  • File printing features
  • Ability to query CAPS LOCK and NUM LOCK states
  • Multi-screen support tailored for embedded systems

JavaFX 18 (March 2022) featured:

  • H.265/HEVC codec compatibility in video playback
  • Introduction of a DirectionalLight type in 3D scenes
  • Support for transparent backgrounds in WebView
  • Node properties managed via CSS
  • Factory methods to create Border and Background objects

JavaFX 19 (September 2022) enhancements included:

  • HTTP Live Streaming support for H.265/HEVC content
  • Fluent binding operations using lambdas such as map, flatMap, orElse
  • Implementation of :focus-visible and :focus-within CSS pseudo-classes

JavaFX 20 (March 2023) improvements comprised:

  • Constrained resize policies for TableView and TreeTableView controls
  • Improved lifecycle management of UI control skins through Skin::install method
  • Streamlined listener handling via ObservableValue::when

Initial releases

The scripting language component of JavaFX originated from Chris Oliver's F3 project.

Sun Microsystems unveiled JavaFX at the May 2007 JavaOne conference. By mid-2008, Sun aimed to launch JavaFX for both browsers and desktop environments by Q3 that year, followed by mobile device support by Q2 of the following year. A collaboration with On2 Technologies enabled advanced video features through the TrueMotion codec. Developers were given early access to the JavaFX SDK and NetBeans plugin for Windows and Mac starting July 2008.

Since version 1.1, major releases have been named after neighborhoods in San Francisco. On December 4, 2008, Sun released JavaFX version 1.0.2.

JavaFX 1.1 (Franca), released February 12, 2009, added mobile development capabilities. The subsequent release, JavaFX 1.2 (Marina), launched at the June 2, 2009 JavaOne conference, introduced beta support for Linux and Solaris platforms; integrated built-in GUI controls and layouts with skinnable CSS; included chart widgets; enhanced I/O handling across desktop and mobile devices; improved performance; and incorporated Windows Mobile Runtime integration.

JavaFX 1.3 (Soma), released April 22, 2010, concentrated on boosting performance, expanding platform compatibility, and refining UI controls. Version 1.3.1 followed in August that year with faster startup times and customizable progress bars.

The release of JavaFX 2.0 (Presidio) on October 10, 2011 marked a major transition: it abandoned the scripting language in favor of new Java APIs to broaden developer accessibility; discontinued mobile platform support; introduced high-performance lazy binding; and announced intentions to open-source the technology. The runtime was adapted to be platform-specific to better utilize native system features such as video codecs.

Oracle improved multithreading via updated Task APIs and engineered the scene graph to allow thread-safe background scene construction.

The beta version of JavaFX 2.0 was available from May 26, 2011 supporting Windows XP/Vista/7 (both x86 and x64), with early Mac OS X access granted to partners; Linux support was planned subsequently. Official Mac OS X compatibility arrived in JavaFX version 2.1; Linux followed in version 2.2.

FXML was introduced in JavaFX 2.0 as a declarative XML-based language for designing user interfaces.

On April 27, 2012 Oracle released JavaFX version 2.1 featuring official Mac OS X desktop support; inclusion of H.264/MPEG-4 AVC and AAC codecs; CoolType font rendering; UI enhancements such as combo boxes and stacked charts; menu bar components; plus a WebView control enabling communication between JavaScript and Java code.

Released August 14, 2012, JavaFX version 2.2 added Linux support including plugin and WebStart capabilities; introduced a Canvas API; incorporated new controls like Color Picker and Pagination; supported HTTP Live Streaming; implemented touch events and gesture recognition; provided image processing APIs; and offered native packaging options allowing applications to be bundled as standalone installers without requiring external JRE or SDK installations.

From Oracle Java SE update 7u6 onward—and starting with JavaFX version 2.2—JavaFX has been distributed as part of the Oracle Java SE platform bundle.

Prospective developments

In November 2012, Oracle made Decora, a domain-specific language (DSL) shader tool for JavaFX that produces shaders compatible with OpenGL and Direct3D, available as open source. According to Oracle's Client Support Roadmap, updates and fixes for JavaFX will be maintained on Java SE 8 until March 2025. Oracle is engaging with external partners to evolve JavaFX into a standalone open-source module. Furthermore, ongoing support for JavaFX is provided by Gluon, which distributes it as an optional module alongside the JDK.

Platform availability

By March 2014, JavaFX was accessible on Windows, macOS, and Linux operating systems. Oracle has developed internal versions targeting iOS and Android platforms, with ARM architecture compatibility introduced in JavaFX 8. In February 2013, Oracle declared intentions to release the iOS and Android implementations as open source within a two-month timeframe. Nevertheless, beginning with JDK 8u33 for ARM processors, JavaFX Embedded support was discontinued, although x86 platform compatibility continues. Gluon offers a commercial JavaFX port tailored for both Android and iOS devices.

Licensing details

Various licenses govern the distribution of JavaFX runtime components:

  • The JavaFX compiler along with an earlier iteration of the 2D Scene graph were distributed under the GPL v2 license.
  • The NetBeans plugin supporting JavaFX is available under a dual license: GPL v2 and CDDL.

Sun Microsystems originally outlined a licensing approach for the initial release of JavaFX. In 2008, Jeet Kaul, then Sun’s Vice President of Client Software, explained that they intended to publish JavaFX specifications and continue open-sourcing the runtime environment while isolating proprietary elements licensed from third parties.

At JavaOne 2011, Oracle Corporation announced that the release of JavaFX 2.0 would be made open source. Since December 2011, Oracle has distributed JavaFX under the GPL accompanied by a linking exception.

In December 2012, Oracle extended its open-source contributions by releasing additional segments of JavaFX code, which included:

  • Classes for animations and timelines
  • Core classes and event delivery systems
  • Interfaces and implementations for the render tree
  • Implementations related to geometry and shapes
  • The Java portion of the rendering engine pipeline
  • Facilities for logging support

Related topics

Bibliography


External links