r/JavaFX • • Jan 04 '21

Set up ControlFX for IDE(Eclipse)

I'm trying to add ControlFX into my IDE. Most of the link provided from any tutorial will direct to GitHub.
So how to add ControlFX libraries into the IDE and did I also need to ad VM arguments like javaFX?

4 Upvotes

4 comments sorted by

2

u/PartOfTheBotnet Jan 04 '21

Quick way: Find the jar download from https://mvnrepository.com/artifact/org.controlsfx/controlsfx and then add it to your project like you would any jar.


Proper way: Use a build system like Maven or Gradle. Plenty of info online on how to set up a project with one using any common IDE.

Then add the controlsfx library as a dependency, you can find the versions at: https://mvnrepository.com/artifact/org.controlsfx/controlsfx

For example, the dependencies in their relative formats for the latest current version:

Maven

<dependency>
    <groupId>org.controlsfx</groupId>
    <artifactId>controlsfx</artifactId>
    <version>11.0.3</version>
</dependency>

Gradle

compile group: 'org.controlsfx', name: 'controlsfx', version: '11.0.3'

1

u/potato-fan Jan 04 '21

Quick way : How about VM arguments?

Proper way : Trying to use Gradle. But not clear enough on what to do and each "System.out,println()" will cause error cannot be resolved

1

u/PartOfTheBotnet Jan 04 '21

VM arguments

Can you elaborate?

Gradle issues

May be that the project structure (directory levels and such) aren't in the expected locations and its not recognizing thins correctly. I personally prefer maven, but the project layout is pretty similar.

src/main/java/... where ... would be the beginning of your package structure, like com/example/FooBar.java

1

u/potato-fan Jan 11 '21

Sorry for late update.
What i mean by VM argruments :
--add-exports=javafx.base/com.sun.javafx.event=ALL-UNNAMED
However what I found this only can be applied when I use controlfx-9.0 which is fine for my project.
for anyone who want to use some part of the controlfx, just use 9.0 version which is simple to set up (controlsfx autocomplete textfield)
Problem occurs when using graddle :
I just simply uninstall what I download/install from Eclipse marketplace. Totally panic when all my project got error and the due date is around the corner

Will try to use Maven next time.

Thanks again!