| Developer(s) | Sun Microsystems (now acquired by Oracle Corporation) |
|---|---|
| Initial release | December 4, 2008; 11 years ago |
| Stable release | 14 / March 11, 2020; 6 months ago[1] |
| Repository | |
| Operating system | Java Runtime Environment |
| Platform | Cross-platform |
| Available in | Java |
| Type | Application framework |
| License | EULA, parts under GPL+linking exception,[2] open-source |
| Website | wiki |
| Java platform editions |
|---|
|
JavaFX is a software platform for creating and delivering desktop applications, as well as rich Internet applications (RIAs) that can run across a wide variety of devices. JavaFX is intended to replace Swing as the standard GUI library for Java SE, but both will be included for the foreseeable future.[3] JavaFX has support for desktop computers and web browsers on Microsoft Windows, Linux, and macOS.
Before version 2.0 of JavaFX, developers used a statically typed, declarative language called JavaFX Script to build JavaFX applications. Because JavaFX Script was compiled to Java bytecode, programmers could also use Java code instead. JavaFX applications could run on any desktop that could run Java SE or on any mobile phone that could run Java ME.[citation needed]
JavaFX 2.0 and later is implemented as a "native" Java library, and applications using JavaFX are written in "native" Java code. JavaFX Script has been scrapped by Oracle, but development is being continued in the Visage project.[4] JavaFX 2.x does not support the Solaris operating system or mobile phones; however, Oracle plans to integrate JavaFX to Java SE Embedded 8, and Java FX for ARM processors is in developer preview phase.[5]
On desktops, JavaFX supports Windows Vista, Windows 7, Windows 8, Windows 10,[6] macOS and Linux operating systems.[7] Beginning with JavaFX 1.2, Oracle has released beta versions for OpenSolaris.[8] On mobile, JavaFX Mobile 1.x is capable of running on multiple mobile operating systems, including Symbian OS, Windows Mobile, and proprietary real-time operating systems.
Open-source JavaFXPorts works for iOS (iPhone and iPad) and Android and embedded (Raspberry Pi);[9] and the related commercial software created under the name "Gluon" supports the same mobile platforms with additional features plus desktop.[10] This allows a single source code base to create applications for the desktop, iOS, and Android devices.
With the release of JDK 11 in 2018, Oracle has made JavaFX part of the OpenJDK under the OpenJFX project,[11] in order to increase the pace of its development.[12] Oracle support for JavaFX is also available, for the current long-term version (Java JDK 8), through March 2025.[13]
JavaFX 1.1 was based on the concept of a "common profile" that is intended to span across all devices supported by JavaFX. This approach makes it possible for developers to use a common programming model while building an application targeted for both desktop and mobile devices and to share much of the code, graphics assets and content between desktop and mobile versions. To address the need for tuning applications on a specific class of devices, the JavaFX 1.1 platform includes APIs that are desktop or mobile-specific. For example, the JavaFX Desktop profile includes Swing and advanced visual effects.
For the end user, the "Drag-to-Install" feature enables them to drag a JavaFX widget - an application residing in a website - and drop it onto their desktop. The application will not lose its state or context even after the browser is closed. An application can also be re-launched by clicking on a shortcut that gets created automatically on the user's desktop. This behavior is enabled out-of-the-box by the Java applet mechanism since the Java 6u10 update, and is leveraged by JavaFX from the underlying Java layer. Sun touts "Drag-to-Install" as opening up of a new distribution model and allowing developers to "break away from the browser".
JavaFX 1.x included a set of plug-ins for Adobe Photoshop and Illustrator that enable advanced graphics to be integrated directly into JavaFX applications. The plug-ins generate JavaFX Script code that preserves the layers and structure of the graphics. Developers can then add animation or effects to the static graphics imported. There is also an SVG graphics converter tool (also known as Media Factory) that allows for importing graphics and previewing assets after the conversion to JavaFX format.
WebView, the embedded browser component, supports the following HTML5 features:
Sun Microsystems licensed a custom typeface called Amble for use on JavaFX-powered devices. The font family was designed by mobile user interface design specialists Punchcut and is available as part of the JavaFX SDK 1.3 Release.
JavaFX 2.x platform includes the following components:
JavaFX Mobile was the implementation of the JavaFX platform for rich Internet applications aimed at mobile devices. JavaFX Mobile 1.x applications can be developed in the same language, JavaFX Script, as JavaFX 1.x applications for browser or desktop, and using the same tools: JavaFX SDK and the JavaFX Production Suite. This concept makes it possible to share code-base and graphics assets for desktop and mobile applications. Through integration with Java ME, the JavaFX applications have access to capabilities of the underlying handset, such as the filesystem, camera, GPS, bluetooth or accelerometer.
An independent application platform built on Java, JavaFX Mobile is capable of running on multiple mobile operating systems, including Android, Windows Mobile, and proprietary real-time operating systems.
JavaFX Mobile was publicly available as part of the JavaFX 1.1 release announced by Sun Microsystems on February 12, 2009.
Sun planned to enable out-of-the-box support of JavaFX on the devices by working with handset manufacturers and mobile operators to preload the JavaFX Mobile runtime on the handsets. JavaFX Mobile running on an Android was demonstrated at JavaOne 2008 and selected partnerships (incl. LG Electronics, Sony Ericsson) were announced at the JavaFX Mobile launch in February, 2009.
JavaFX Script, the scripting component of JavaFX, began life as a project by Chris Oliver called F3.[14]
Sun Microsystems first announced JavaFX at the JavaOne Worldwide Java Developer conference on May 2007.
In May 2008 Sun Microsystems announced plans to deliver JavaFX for the browser and desktop by the third quarter of 2008, and JavaFX for mobile devices in the second quarter of 2009. Sun also announced a multi-year agreement with On2 Technologies to bring comprehensive video capabilities to the JavaFX product family using the company's TrueMotion Video codec. Since end of July 2008, developers could download a preview of the JavaFX SDK for Windows and Macintosh, as well as the JavaFX plugin for NetBeans 6.1.
Major releases since JavaFX 1.1 have a release name based on a street or neighborhood in San Francisco. Update releases typically do not have a release name.[15]
Oracle announced their intention to stop shipping JavaFX with JDK 11 and later,[16] and it's no longer bundled with the latest version.
On December 4, 2008 Sun released JavaFX 1.0.2.
JavaFX for mobile development was finally made available as part of the JavaFX 1.1 release (named Franca[15]) announced officially on February 12, 2009.
JavaFX 1.2 (named Marina[15]) was released at JavaOne on June 2, 2009. This release introduced:[17]
JavaFX 1.3 (named Soma[15]) was released on April 22, 2010. This release introduced:[18]
This version was released on August 21, 2010. This release introduced:
This version (named Presidio[15]) was released on October 10, 2011. This release introduced:
Various improvements have been made within the JavaFX libraries for multithreading. The Task APIs have been updated to support much more concise threading capabilities (i.e. the JavaTaskBase class is no longer necessary since all the APIs are in Java, and the requirement to have a callback interface and Java implementation class are no longer necessary). In addition, the scene graph has been designed to allow scenes to be constructed on background threads and then attached to "live" scenes in a threadsafe manner.
On May 26, 2011, Oracle released the JavaFX 2.0 Beta. The beta release was only made available for 32 and 64 bit versions of Microsoft Windows XP, Windows Vista and Windows 7. An Early Access version for Mac OS X was also available for members of the JavaFX Partner Program at the time, while Linux support was planned for a future release of JavaFX. JavaFX 2.0 was released with only Windows support. Mac OS X support was added with JavaFX 2.1. Linux support was added with JavaFX 2.2.
JavaFX 2.0 makes use of a new declarative XML language called FXML.[19][20]
On April 27, 2012, Oracle released version 2.1 of JavaFX,[21] which includes the following main features:[22]
On August 14, 2012, Oracle released version 2.2 of JavaFX,[23] which includes the following main features:[24]
JavaFX 2.2 adds new packaging option called Native Packaging, allowing packaging of an application as a "native bundle". This gives users a way to install and run an application without any external dependencies on a system JRE or FX SDK.
As of Oracle Java SE 7 update 6 and Java FX 2.2, JavaFX is bundled to be installed with Oracle Java SE platform.[3]
JavaFX is now part of the JRE/JDK for Java 8 (released on March 18, 2014) and has the same numbering, i.e., JavaFX 8.[3]
JavaFX 8 adds several new features, including:[25]
JavaFX 9 features were centered on extracting some useful private APIs from the JavaFX code to make these APIs public:
First shipped 2018-09.
First shipped 2019-03.
JavaFX 13 shipped in September 2019.
JavaFX 14 is the latest JavaFX release available now.
Oracle also announced in November 2012 the open sourcing of Decora, a DSL Shader language for JavaFX allowing to generate Shaders for OpenGL and Direct3D.[32]
Oracle wrote in its Client Support Roadmap that JavaFX new fixes will continue to be supported on Java SE 8 through March 2025[13]. Previously, Oracle announced that they are "working with interested third parties to make it easier to build and maintain JavaFX as a separately distributable open-source module." JavaFX will continue to be supported in the future by the company Gluon as a downloadable module in addition to the JDK.[33]
The following is a rather simple JavaFX-based program. It displays a window (a Stage) containing a button.
package javafxtuts; import javafx.application.Application; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.layout.StackPane; import javafx.stage.Stage; public class JavaFxTuts extends Application { public JavaFxTuts() { //Optional constructor } @Override public void init() { //By default this does nothing, but it //can carry out code to set up your app. //It runs once before the start method, //and after the constructor. } @Override public void start(Stage primaryStage) { // Creating the Java button final Button button = new Button(); // Setting text to button button.setText("Hello World"); // Registering a handler for button button.setOnAction((ActionEvent event) -> { // Printing Hello World! to the console System.out.println("Hello World!"); }); // Initializing the StackPane class final StackPane root = new StackPane(); // Adding all the nodes to the StackPane root.getChildren().add(button); // Creating a scene object final Scene scene = new Scene(root, 300, 250); // Adding the title to the window (primaryStage) primaryStage.setTitle("Hello World!"); primaryStage.setScene(scene); // Show the window(primaryStage) primaryStage.show(); } @Override public void stop() { //By default this does nothing //It runs if the user clicks the go-away button //closing the window or if Platform.exit() is called. //Use Platform.exit() instead of System.exit(0). //This is where you should offer to save any unsaved //stuff that the user may have generated. } /** * Main function that opens the "Hello World!" window * * @param arguments the command line arguments */ public static void main(final String[] arguments) { launch(arguments); } }
As of March 2014 JavaFX is deployed on Microsoft Windows, OS X, and Linux.[34] Oracle has an internal port of JavaFX on iOS and Android.[35][36] Support for ARM is available starting with JavaFX 8[37] On February 11, 2013, Richard Bair, chief architect of the Client Java Platform at Oracle, announced that Oracle would open-source the iOS and Android implementations of its JavaFX platform in the next two months.[38][39] Starting with version 8u33 of JDK for ARM, support for JavaFX Embedded has been removed.[40] Support will continue for x86-based architectures.[41]
A commercial port of JavaFX for Android and iOS has been created under the name "Gluon".[10]
There are various licenses for the modules that compose the JavaFX runtime:
During development, Sun explained they will roll out their strategy for the JavaFX licensing model for JavaFX first release.[46] After the release in 2008, Jeet Kaul, Sun's Vice president for Client Software, explained that they will soon publish a specification for JavaFX and its associated file formats, and will continue to open-source the JavaFX runtime, and decouple this core from the proprietary parts licensed by external parties.[47]
At JavaOne 2011, Oracle Corporation announced that JavaFX 2.0 would become open-source.[48] Since December 2011, Oracle began to open-source the JavaFX code under the GPL+linking exception.[2][49]
In December 2012, new portions of the JavaFX source code were open-sourced by Oracle:[50]
The update introduces a new XML-based markup language called FXML, which is aimed at defining user interfaces. Other scripting languages, such as Groovy, JRuby and Scala, can also be used to write apps in JavaFX 2.0, as can the Java development tools NetBeans and Eclipse.
I'm going to be open sourcing today another one of our projects called decora-compiler. We have our own DSL for shader languages called Decora. What we do is generate shaders for OpenGL and D3D from this language. We also generate Java code and SSE native code. For some shaders, we ended up generating them and then hand-tweaking them from there
We’re also going to open source our iOS and Android implementations over the next couple months.
Oracle has announced plans to open source the iOS and Android implementations of its JavaFX UI platform "over the next couple of months", allowing developers to use the technology to write cross-platform applications for those platforms for the first time.
Starting with JDK 8u33, JavaFX Embedded is removed from the ARM bundle and is not supported.
JavaFX continues to be provided as a fully supported part of the Oracle JDK 8 product on x86 platforms (Windows, Linux, Mac).
Sun will continue to engage the OpenJFX community as we release JavaFX products. This fall we will be rolling out our open source strategy for JavaFX technology concurrent with the release of version 1 of JavaFX Desktop
Sun is committed to open standards and open source, and specifications are coming soon(…)There are some dependencies on licensed code that cannot be open sourced. We are working towards decoupling the dependencies so that the non-proprietary portions can be open sourced. Currently the JavaFX compiler, Netbeans JavaFX plugin and Eclipse JavaFX plugin are already being developed in the open source. The scene graph is out in the open. We will put the core runtime out in the open over time.
At the event, Oracle also announced plans to make the JavaFX platform open source. It has submitted a proposal to the OpenJDK Community, and its first contribution will include the JavaFX user interface controls and related libraries. "Other JavaFX components are planned to follow in multiple phases," the company said.
Hey guys, Just a note to indicate that the UI controls have been open sourced into openjdk[unreliable source?]
Hello everyone, today we open-sourced another part of JavaFX. Following projects are now part of OpenJFX