Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Importing JFoenix library to SceneBuilder - javaFX

I downloaded library JFoenix.jar from official site for Java 8.

I want to import that library to Scene Builder (Gluon). But everytime I try to import it, I dont have all elements from that library (it misses for example JFXButton, JFXTextarea etc.).

I can import only 21 elements from that library, and I dont know what I am doing wrong. Anyone can help?

Screenshots:

Importing library importing library

only imports 21 elements: can only import 21 elements

like image 207
Rocky3582 Avatar asked Feb 17 '18 12:02

Rocky3582


People also ask

How do I import from Jfoenix?

1, JAR/FXML Manager -> Search repositories for jfoenix and select com. jfoenix:jfoenix as this will pick the latest version available: Then click Add Jar, it will add 44 components again.

How do I import a jar file into Scene Builder?

Create class file with extending combo box, controller and add controller in FXML file (in scene builder). Find "Import from JAR/FXML file" in combo box near to left search box in scene builder and then select the file. Now you have new title pane in left accordion with name Custom. There you can find your components.

What is Jfoenix JavaFX?

JFoenixisanopensourceJavalibrary,thatimplementsGoogleMaterialDesignusingJavacomponents.


2 Answers

Many JavaFX custom controls are no longer compatible between Java 8 and 9 versions due mainly to the changes in the JavaFX API (if they were using private skins).

This can be noticed with Scene Builder, which is a JavaFX application after all running either Java 8 or 9.

If you want to add custom libraries like JFoenix to Scene Builder you have to choose the right library for the right version:

  • JFoenix 8.0.2 works fine for Scene Builder 8.4.1
  • JFoenix 9.0.1 works fine for Scene Builder 9.0.1

JavaFX 8

Scene Builder 8.4.1, JAR/FXML Manager -> Manually add Library from Repository, and search for com.jfoenix, jfoenix, selecting the latest 8 version (8.0.2):

then click Add Jar, you'll see 44 components:

Adding Jfoenix 8.0.2

JavaFX 9

Scene Builder 9.0.1, JAR/FXML Manager -> Search repositories for jfoenix and select com.jfoenix:jfoenix as this will pick the latest version available:

Then click Add Jar, it will add 44 components again.

Mixing versions

But if using Scene Builder 9.0.1 you select 8.0.2 (manually add Library from Repository, and search for com.jfoenix, jfoenix, selecting the version, 8.0.2), you will get only 23 components:

JFoenix 8 in Scene Builder 9

These components seem compatible between Java 8 and 9, while the 21 missing are no longer compatible.

At the end, it will depend on your real project. If you are targeting JDK 8, I'd suggest you stick to Scene Builder 8.4.1, so you can use the same library versions as in your project.

like image 135
José Pereda Avatar answered Oct 11 '22 13:10

José Pereda


Simple Check scene builder version if its 9 then uninstall and install scene builder 8.x.x for netbeans version 8.x.x

if you have netbeans 11 then use scene builder version 11

i wasted enough time on this hope you don't and this helps. Have a good day ! :)

like image 1
Muzamil Mehmood Avatar answered Oct 11 '22 13:10

Muzamil Mehmood