0

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

2
  • 2
    You are probably going to need to do a new JavaFX project. Just use the ideas and classes in the new project. You can probably improve the classes by using properties instead of regular variables. Commented Feb 3, 2022 at 14:33
  • 1
    "I just keep getting a lot of different errors"... you should mention the errors you are getting.. otherwise nobody can predict what you are doing. Commented Feb 3, 2022 at 23:58

1 Answer 1

1

Make a new project

enter image description here

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.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks for this. I've tried this and now get an error saying: package java.awt is not visible (package java.awt is declared in module java.desktop, but module maptrix.wiseguide does not read it). Do you have any ideas what this is?
@Wpitchy I suggest you write another Question on that specific issue, after searching Stack Overflow thoroughly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.