Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JavaFX scene builder 2: controller class

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.

like image 997
jan behang Avatar asked Jan 11 '14 09:01

jan behang


People also ask

Can a FXML have multiple controllers?

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.

What is JavaFX scene builder?

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.

What do I need for JavaFX 2 support?

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.

How do I set the controller class in Scene Builder?

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.

Does Scene Builder 2 early access remove controller class from FXML?

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.


1 Answers

As you see on the image the controller menu moved on the left , below the Library List. enter image description here

like image 133
Muhamet Aljobairi Avatar answered Sep 22 '22 15:09

Muhamet Aljobairi