I want to use sceneBuilder
for a javaFx
application. I have a Package
that is called testPac
and inside that I have the folders as has been presented in figure 1;
I have one fxml
file and its controller
inside the view
folder.
now, I don't know what I must use inside the controller box in sceneBuilder
.
the content of view
folder according to figure 2.
You just need to specify the fully-qualified classname, i.e. packagename.ClassName
. So, if I understand your project structure correctly, your controller class is scaterChartController
1 and it is in a package called testPac.view
1,2. So your fx:controller
attribute should have the value fx:controller = "testPac.view.scaterChartController"
.
In SceneBuilder you can set this in the "Controller" pane which is in the bottom left of the screen (expand it if necessary):
scaterChartController
is not a proper class name according to the standard convention. Similarly, package names should be all lower case, so "a package called testPac
" also violates the convention.The package name is evident from the first line of code. I am assuming you have a package name of view
, so the first line of code in the controller class will be
package testPac.view ;
Modify the fx:controller
attribute accordingly if the package is different to that.