2

Using JavaFX2.2 along with SceneBuilder 1.0 in NetBeans to take advantage of the seamless development environment it provides. I would like to add the controls from the JFXtras lab, and as such, I'd like to find out if it's possible to integrate the JFXtras controls into SceneBuilder. I found a document from Oracle regarding loading jar files into SceneBuilder to make it aware of custom controls. The documentation claims that you might not be able to actually use the control in SceneBuilder, but its controls would be 'passed through' untouched so you could actually save the file without losing the added custom controls. Well, I've tried, and it doesn't seem to work. I can't actually load the fxml file, getting exceptions about instantiation of bean failed. Has anyone been able to use JFXtras with SceneBuilder?

kpenrose
  • 186
  • 2
  • 14

1 Answers1

5

I'm using JFXtra in my project but I have to manually add them in the FXML code with the correct fx:id and stuff. SceneBuilder then holds free the place where the JFXtra node should be. Do you have the correct import and classpath in your FXML file?

<?import jfxtras.labs.scene.control.*?>
<?scenebuilder-classpath-element ../../../libraries/JFXtras2/jfxtras-labs-0.1.jar?>
Perneel
  • 3,317
  • 7
  • 45
  • 66
  • Thanks Perneel! I hadn't added these statements to the FXML file. Somehow I missed that in the documentation, and NetBeans doesn't flag the error in the FXML file for an unknown control (node). – kpenrose Aug 28 '12 at 19:28
  • I'm glad it solved the problem, took me a while to figure it out myself as well ;) – Perneel Aug 28 '12 at 19:31