JavaFx scenebuilder和Maven集成 [英] JavaFx scenebuilder and Maven Integration
问题描述
我已经在eclipse中创建了JavaFx8 Maven项目.我已经将我的fxml文件放在/src/main/resources/fxml/中.我可以使用FxmlLoader从Java文件加载fxml.但是,我无法使用Scenebuilder从Fxml文件中选择控制器类.
I have created a JavaFx8 Maven project in eclipse. I have put my fxml files in /src/main/resources/fxml/. I am able to the load the fxml from the java files using FxmlLoader. But, I'm not able to pick the controller class from Fxml file using Scenebuilder.
我该怎么做才能在Scenebuilder工具中自动看到控制器类?
What should I do to be able to see the controller class automatically in the Scenebuilder tool ?
我发现了类似的问题,但答案并不明确.我无法登录到吉拉案件.
I have found a similar question, but the answer wasnt clear. I wasnt able to login to the jira case.
告诉JavaFX Scene Builder在哪里寻找控制器类
推荐答案
我最初将fxml文件放在/src/main/java相同的文件夹中.然后,我使用scenebuilder映射了所有元素/控制器.
I have put the fxml file in the same folder /src/main/java initially. Then, I mapped all the elements/controller using scenebuilder.
完成映射后,我已将fxml移至/src/main/resources文件夹.这行得通.
Once mapping is done, I have moved the fxml to /src/main/resources folder. This works.
这篇关于JavaFx scenebuilder和Maven集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!