i installed netbeans with java se7, and javafx samples are running fine. In scenebuilder, i can select an ID for each control defined and annotated with @FXML in my controller. however, i like my project organised. when i create a new package, and move my FXML file there, (myapp/views) and the controller stays in the root where it was -> myapp, then in scenebuilder does not seem to find the id.

I know about the 'controller class' in the FXML, but since i didn't move my controller, that should not be changed.

More specific, when both my controller and fxml are in the package 'holidayapp', it works. moving the fxml to a subpackage holidayapp/views', doesn't work. The controller class remains

<AnchorPane id="AnchorPane" prefHeight="200" prefWidth="320" xmlns:fx="http://javafx.com/fxml" fx:controller="holidayapp.HolidayViewController">

as the HolidayViewController remains in the root package. I do nothing else but moving the fxml file from the main package into a subpackage.

I would like to see the id's from the holidayViewController in my scenebuilder. Compoling and running with the fxml in a subpackage, was never any problem.

Thanks

有帮助吗?

解决方案

I think you might be suffering from the following issue:

https://bugs.openjdk.java.net/browse/JDK-8091793

If you think you do, please consider to vote for and/or comment on this issue.

其他提示

The way I worked with this was placing my Main class into the view (the one that extends Application). This gave me access to my Controller classes, their variables, and methods. This works for SceneBuilder 1.1.

I can only speak for when using Eclipse and not NetBeans so doing this may still result in nothing.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top