You are viewing an old version of this page. View the current version.
Compare with Current
View Page History
« Previous
Version 6
Next »
Using JavaFX with the latest JDK versions: A guide for developers familiar with JavaFX on JDK 8
This document serves as a guide for developers familiar with JavaFX from JDK 8 who wish to take advantage of the open source, stand alone, JavaFX bundle available for the latest JDK Feature releases.
Note : Please see the JDK migration guide for information on migrating your application from JDK 8u to newer JDK versions. This document covers the additional information specific to JavaFX.
Modifications required to JavaFX application
While JavaFX generally takes care of the backward compatibility, a migration from JavaFX-8u to the current version of JavaFX is a big leap. A lot has changed between JDK 8 and later releases. Almost all of those changes will be beneficial, but there are a few that will require some adjustments to application's code.
Why is this a significant leap?
- Modularization was introduced in JavaFX 9 (part of JDK 9). This version introduced encapsulation resulting in access removal of internal APIs which were public in JavaFX-8u.
- JavaFX 11 was un-bundled from JDK from version JDK 11. JavaFX was redesigned to be available as a stand-alone library rather than being included with the JDK.
- Accumulated changes from JavaFX 11 to the current version of JavaFX - some deprecation and new API additions.
- The JavaFX API has evolved iteratively over these intermediate versions and you might find that some of the APIs you are familiar with have been removed or deprecated.
A list of deprecated classes and APIs is available at -
https://download.java.net/java/GA/javafx24/docs/api/deprecated-list.html
An exhaustive list of new classes and APIs is available at -
https://download.java.net/java/GA/javafx24/docs/api/new-list.html
Here is a list of most important changes -
- Encapsulation was introduced in JDK 9. It did three things -
- Revoked the access of non-public APIs (classes under com.sun.* packages)
- Removed several deprecated and undocumented "impl_*" methods. (Refer - JDK-8144585)
- Removed the internal Skin and CSS APIs from `com.sun.javafx.scene.control.skin` and `com.sun.javafx.css`.
- Important APIs were added to provide replacements for earlier internal APIs
- A public Skin API was created in the `javafx.scene.control.skin` package, replacing the internal Skin classes formerly in `com.sun.javafx.scene.control.skin`. (See JDK-8077916)
- A public CSS API was created in the `javafx.css` package, replacing the internal CSS classes formerly in `com.sun.javafx.css`. (See JDK-8077918)