Hi im building a JavaFX project and am using JavaFX Scene Builder 2. I wanted to link my controller to my fxml file but i can't see the possibility to add a controller to my fxml file in Scene Builder 2. I was wondering if someone could help me out. Thank you.
During the loading of your FXML markup, there is only the provision to have one controller specified for your scene graph. You are able to load other FXML markup files and nest controllers, but I don't think that's what you're asking.
JavaFX scene builder: This was introduced for Java FX 2.1 and later. A user interface (UI) is created by dragging and dropping controls from a palette. This information is saved as an FXML file, a special XML format.
For JavaFX 2 support you need at least NetBeans 7.1.1. For Eclipse users there is a community-supported plugin hosted on e (fx)clipse. JavaFX scene builder: This was introduced for Java FX 2.1 and later. A user interface (UI) is created by dragging and dropping controls from a palette.
Scene Builder 1.1 has a feature in the right hand code panel where you can set the controller class. Scene Builder 2 does not seem to have this feature. Therefore, if you use SceneBuilder 2, you will need to set the controller class manually as xxlali says.
If, as you indicate, Scene Builder 2 early access sometimes removes your manually set controller class from the FXML file, then that would be one more reason to use a stable certified version rather than the immature early access version. Highly active question.
As you see on the image the controller menu moved on the left , below the Library List.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With