Issue
As part of a uni project, I'm trying to add a GUI to an existing Java project using JavaFX. The initial project used Java 11 and the JavaFX version I have is 17.0.2 but I just keep getting a lot of different errors depending on what I do. I'm using IntelliJ IDEA
Does anyone know how to add JavaFX to existing projects?
My lecturer is no help at all
Solution
Make a new project
I suggest setting up a new JavaFX-focused project.
IntelliJ offers a project template expressly for that purpose. See this documentation page, Create a new JavaFX project.
Then move over any existing code you have. You can do so by drag-and-drop into the project window.
You will find the OpenJFX library has been included as a dependency. OpenJFX is an open-source implementation of JavaFX. OpenJFX is organized as a sub-project on the OpenJDK project, co-led by Gluon and Oracle.
Answered By - Basil Bourque
Answer Checked By - Clifford M. (JavaFixing Volunteer)