The JavaFX platform enables developers to create and deploy Graphical User Interface (GUI) applications that behave consistently across multiple platforms. JavaFX 1.3 and older, were scripting languages, whereas JavaFX 2.x+/8.x enables users to use Java. FXML enables JavaFX to follow an MVC architecture.
The JavaFX platform enables developers to create and deploy Graphical User Interface (GUI) applications that behave consistently across multiple platforms. It is built on java
technology and was part of the Oracle JDK from JDK 8 until Java 10. Since JDK 11, JavaFX is shipped as a library, independent of most JDK and JRE distributions.
External Resources
- JavaDoc: Modules JavaFX 17
- Introduction to FXML
- JavaFX CSS Reference Guide
- openjfx.io - documentation, downloads and links for Open Source JavaFX.
- Getting Started with JavaFX
- Oracle documentation for JavaFX - Only covers Java 8, but still high quality and relevant.
- SceneBuilder GUI design tool for JavaFX (FXML) - Open Source, maintained by Gluon.
- Working with JavaFX UI Components - Oracle's basic tutorial on how-to use controls, charts and skinning
- FX Experience: JavaFX News, Demos, and Insight
- JavaFX How to Example - bare-bones code examples for using controls
- List of JavaFX resources - libraries, frameworks, books, blogs, people, tutorials, etc.
- Eden coding JavaFX tutorials.
Tag Usage
javafx
accumulates questions on all version as it tends to be used on the current version at the time the question is asked.javafx-18
is dedicated to questions that are specific to the JavaFX 18 version.javafx-17
is dedicated to questions that are specific to the JavaFX 17 version.javafx-11
is dedicated to questions that are specific to the JavaFX 11 version.javafx-8
is dedicated to questions that are specific to the JavaFX 8 version.
Outdated tags - do not use, instead update your environment to a recent version
javafx-2
is dedicated to questions that are specific to the JavaFX 2+ version.javafx-1
is dedicated to questions that are specific to JavaFX 1.x releases which used JavaFX Script language
Frequently Asked Questions
People often ask these questions about this topic:
Installation
- How to install JavaFX11 with Java11 (same for all versions >= 11)
- Module error when running JavaFx media application - same for all modules that are not automatically pulled in by javafx.controls (media, fxml, swing, ..)
- How to Fix JavaFX’s “Runtime Components are Missing” Error
- JDK and JRE versions that include JavaFX modules:
- Separate packaging for JavaFX SDK or modules from Gluon.
- JavaFX modules in Maven, if you want something stable, use a recent or LTS version without the
ea
qualifier. - Using the IntelliJ Idea New JavaFX Project Wizard to quickly, easily and reliably create a new modular JavaFX project.
Resource Lookup
- How do I determine the correct path for FXML files, CSS files, Images, and other resources needed by my JavaFX Application?
- Where to put resource files in JavaFX
FXML
- Using MVC with JavaFX
- How to pass parameters between controllers (FXML)
- JavaFX FXML controller - constructor vs initialize method
- What's the difference between fx:id and id: in JavaFX FXML?
- JavaFX - problems with FXML - accidentally wrong imports (must be javafx, not awt)
- JavaFX, Label null pointer exception - controller must be loaded (not instantiated)
- Can application class be the controller class?
- javafx 8 compatibility issues - FXML static fields
- Don't set @FXML fields to new values
Packaging
- Packaging JavaFX Applications
- openjfx information on runtime images - official getting started guide for packaging JavaFX apps.
- How to create a standalone .exe in Java (that runs without an installer and a JRE)
- Creating a "fat jar" - a single jar that includes both the javafx runtime and application classes plus application dependencies designed to run on a pre-installed JRE (not recommended or supported, consider other options like jpackage and jlink).
- jpackage user guide - jdk tool to package an application installable using a native installer.
- jlink command - jdk tool to create a custom runtime that can include the JVM, JavaFX modules, your application and your applications dependent modules, with a script launcher.
- badass jlink plugin and badass runtime plugin - packaging using gradle.
- JPackageScriptFX - maven and script based: demonstrates how projects can use scripts to build self-contained, platform-specific executables and installers of their JavaFX applications
- openjfx-maven-plugin - can invoke jlink from maven.
- akman jpackage maven plugin - can invoke jpackage from maven.
- graalvm based apps - apps that are compiled directly to native code and run without a JVM.
- jdeploy - native deployment option.
- Copy external resource files after building JavaFX app with Maven - post-deployment customization.
- JavaFX runtime components - what they are, why you need them, and how to get them.
Virtualized Controls
- JavaFX TableView not showing data in all columns
- PropertyValueFactory error on proper getter from model class
- How can I Populate a ListView in JavaFX using Custom Objects?
- JavaFX: Display image in ListView without breaking selection model - the real issue is not calling super in updateItem
- javafx listview and treeview controls are not repainted correctly - incomplete configuration of cell in updateItem
- Show JSON in TableView
- JavaFX Combobox show attribute of element
- Why should I avoid using
PropertyValueFactory
Misc
- What is a NullPointerException, and how do I fix it?
- Periodic Background Tasks in JavaFX
- How to achieve a common MenuBar for multiple scenes in JavaFx
- Swing vs JavaFX for desktop applications
- Integrating JavaFX 2.0 WebView into a Swing Java SE 6 Application
- Using JavaFX in JRE 8
- Is it possible to run JavaFX applications on iPhone/Android/Win8 mobile?
- JavaFX Application Icon
- Restricting
TextField
character input to integers (or other masks) using aTextFormatter