JavaFX Setup and Scene Builder
JavaFX Download
JavaFX is an open source, next generation cliet application platform for desktop, mobile, and embedded systems built on Java. JavaFX is a standalone component and builds on top of a JDK. You will need to install a JDK that works with the JavaFX version you plan to use.
- Download the latest ready to use version here jdk.java.net.
- From this page, you will have the option to download one of four versions. Choose the version for your operating system:
- Linux/x64
- macOS/AArch64
- macOS/x64
- Windows/x64
- Depending on the version you download, you will then need to either unzip or expand the file. You can save the content of these files anywhere on your computer.
- For more on JavaFX, check out these JavaFX tutorials.
Scene Builder in IntelliJ
You can definitely use another IDE, but IntelliJ IDE has a Scene Builder that makes working with JavaFX scenes easier.
- Download the IntelliJ IDE. The IntelliJ IDEA Community Edition is a free version.
- IntelliJ IDEA has the following materials to assist in building JavaFX projects:
- Once downloaded, open up the settings and install the JavaFX bundle plugin to give you access to the Scene Builder.
- Scene Builder allows you to structure the graphical user interface of the app visually without having to write FXML code.
- On the left pane of the Scene Builder are all the objects that can be added to the app interface.
- On the right pane you have three sections: Properties, Layout, and Code.
- The Properties are like the instance variables that set up the object.
- The Code defines the name of the object and the methods that will be available, such as On Action behaviors.
- Once the scene is set up, right click on the fxml file and select Update Controller from FXML to have the Scene Builder write the FXML for you.