***
### What is the state of the JavaFX/OpenJFX?
>Libraries and software are available for the complete lifecycle of an application to run from a single codebase on Windows, macOS, Linux, Android, and iOS. JavaFX was originally part of the JDK, the Java Development Kit, and became a standalone technology in 2018.
> Since Java 11, JavaFX was removed from the SDK. It is now in its own separate module, and if you want to use it in your application, you will need to specifically include it.
^619620
You may find anything related to JavaFX at [JFX-Central](https://www.jfx-central.com/home).
### How to develop JavaFX applications?
**JavaFX** builds on top of JDK and is a **standalone componen**t. There are 2 different options for developing JavaFX applications:
- Use the [JavaFX SDK](https://gluonhq.com/products/javafx/) (choosing between 17 LTS, latest release or an early access build).
- Use a build system (e.g. [Maven](https://maven.apache.org/)/[Gradle](https://gradle.org/)) to download the required modules from Maven Central (choosing as well between the same mentioned versions).
See:
- [How to build JavaFX applications via Maven](https://openjfx.io/openjfx-docs/#maven)
- [How to build JavaFX applications via Gradle](https://openjfx.io/openjfx-docs/#gradle)
- [JavaFX and IntelliJ IDEA](https://openjfx.io/openjfx-docs/#IDE-Intellij)
### Can I use Swing components inside JavaFX?
Swing and JavaFX can be used together. However, JavaFX is the way to go.
See:
- [[JavaFX and Swing strengths]]
- [[Swing inside JavaFX]]
- [[JavaFX inside Swing]]
### How to design JavaFX application user interfaces?
You may use [Scene Builder](https://gluonhq.com/products/scene-builder/)
> JavaFX Scene Builder is a visual layout tool that lets users quickly design JavaFX application user interfaces, without coding. Users can drag and drop UI components to a work area, modify their properties, apply style sheets, and the FXML code for the layout that they are creating is automatically generated in the background. The result is an FXML file that can then be combined with a Java project by binding the UI to the application’s logic.
IntelliJ IDEA allows you to open `.fxml` files in JavaFX Scene Builder right from the IDE after you specify the path to the Scene Builder application in the settings. See [how to Configure JavaFX Scene Builder](https://www.jetbrains.com/help/idea/opening-fxml-files-in-javafx-scene-builder.html).
### How to build JavaFX application executables?
You can use [jpackage tool](https://docs.oracle.com/en/java/javase/14/docs/specs/man/jpackage.html).
> The `jpackage` tool will take as input a Java application and a Java run-time image, and produce a Java application image that includes all the necessary dependencies. It will be able to produce a native package in a platform-specific format, such as an exe on Windows or a dmg on macOS. Each format must be built on the platform it runs on, there is no cross-platform support. The tool will have options that allow packaged applications to be customized in various ways.
See:
- [How to use jpackage with Maven](https://github.com/dlemmermann/JPackageScriptFX). It's especially useful for **non-modular projects**.
- [Distributing JavaFX desktop applications without requiring a JVM](https://walczak.it/blog/distributing-javafx-desktop-applications-without-requiring-jvm-using-jlink-and-jpackage). It's specially useful for **modular projects built via Gradle**.
- [The Badass Runtime Plugin](https://badass-runtime-plugin.beryx.org/releases/latest/). It's specially useful for **non-modular projects built via Gradle**.
***
**References**:
- [Foojay Podcast #9: The State of JavaFX Framework, Libraries, and Projects](https://foojay.io/today/foojay-podcast-9/)
- [Using JavaFX with Java 11 or Higher](https://blog.idrsolutions.com/using-javafx-with-java-11/)
- [Getting Started with JavaFX](https://openjfx.io/openjfx-docs/#introduction)
- [IntelliJ IDEA - Create a new JavaFX project](https://www.jetbrains.com/help/idea/javafx.html#create-project)
- [IntelliJ can't recognize JavaFX 11 with OpenJDK 11](https://stackoverflow.com/questions/52467561/intellij-cant-recognize-javafx-11-with-openjdk-11)
- [How to use Jpackage to make a distribution format for JavaFX applications](https://stackoverflow.com/questions/68871952/how-to-use-jpackage-to-make-a-distribution-format-for-javafx-applications)