0

I am developing a Java desktop application using JavaFX and for developing UI I am using Scene Builder 8.3.0. The issue that I am having is when I am trying to add a java class of a different package to my home.fxml file, scene builder do not show it in the list. But if the java class and fxml file are in the same package (same directory), I can add the controller java class (homeController.java) to fxml.

How can I add a controller java class of a different package to my fxml file via scene builder ?

Chamalee De Silva
  • 687
  • 1
  • 9
  • 28

1 Answers1

-1

I think you are asking: how do I import a custom JavaFX component so that it can be used in SceneBuilder.

This can be accomplished using the JAR/FXML Manager. It is available from the menu that appears when you click the "gear" icon in the Library panel: Scene Builder library gear menu image

In the dialog that appears click the "Add Library/FXML from file system", select the jar containing the custom JavaFX component you wish to import. If any are found, then the "Import Dialog" will appear allowing you to choose which custom components to import: Import Dialog Clicking the "Import Component" button will result in a "Custom" section appearing in the library of components on the left:

Custom component accordion item

Old Oracle/Sun documentation of SceneBuilder pertaining to Managing Custom GUI Elements: http://docs.oracle.com/javase/8/scene-builder-2/user-guide/library-panel.htm#CIHCFBID

tunabot
  • 402
  • 3
  • 6
  • This is not what I am expecting. I am asking how I can import a java class which is in a different package to an .fxml file using scene builder. – Chamalee De Silva Mar 11 '17 at 09:35