简体   繁体   中英

Javafx SceneBuilder 2.0 cant load fxml

I've got problem with SceneBuilder open my main.fxml . Everything working fine when i run the project but i cant modify under SceneBuilder . Every time i want to add to main.fxml i need to remove includes do what i want and manually paste code in fxml instead in SceneBuilder (cannot include under tab?).

main.fxml

  <Tab text="Details">
           <content>
              <ScrollPane prefHeight="200.0" prefWidth="200.0">
                 <content>
                    <fx:include fx:id="details" source="/view/tab/details.fxml" /> // line number 59
                 </content>
              </ScrollPane>
           </content>
      </Tab>

My structure package

...
|---> view
      main.fxml
      |--> view.tab
           details.fxml
           ...

Error from SceneBuilder

java.io.IOException: javafx.fxml.LoadException: 
/C:/Users/Michal/Dropbox/workspace/Java/Feeder%20v%202.0/src/view/main.fxml:59
at com.oracle.javafx.scenebuilder.kit.fxom.FXOMLoader.load(FXOMLoader.java:92)
at com.oracle.javafx.scenebuilder.kit.fxom.FXOMDocument.<init>(FXOMDocument.java:80)
at com.oracle.javafx.scenebuilder.kit.fxom.FXOMDocument.<init>(FXOMDocument.java:95)
at com.oracle.javafx.scenebuilder.kit.editor.EditorController.updateFxomDocument(EditorController.java:2370)
at com.oracle.javafx.scenebuilder.kit.editor.EditorController.setFxmlTextAndLocation(EditorController.java:655)
at com.oracle.javafx.scenebuilder.app.DocumentWindowController.loadFromFile(DocumentWindowController.java:386)
at com.oracle.javafx.scenebuilder.app.SceneBuilderApp.performOpenFiles(SceneBuilderApp.java:579)
at com.oracle.javafx.scenebuilder.app.SceneBuilderApp.handleOpenFilesAction(SceneBuilderApp.java:447)
at com.oracle.javafx.scenebuilder.app.SceneBuilderApp.handleLaunch(SceneBuilderApp.java:427)
at com.oracle.javafx.scenebuilder.app.AppPlatform.requestStartGeneric(AppPlatform.java:139)
at com.oracle.javafx.scenebuilder.app.AppPlatform.requestStart(AppPlatform.java:106)
at com.oracle.javafx.scenebuilder.app.SceneBuilderApp.start(SceneBuilderApp.java:371)
at com.sun.javafx.application.LauncherImpl$8.run(LauncherImpl.java:837)
at com.sun.javafx.application.PlatformImpl$7.run(PlatformImpl.java:335)
at com.sun.javafx.application.PlatformImpl$6$1.run(PlatformImpl.java:301)
at com.sun.javafx.application.PlatformImpl$6$1.run(PlatformImpl.java:298)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl$6.run(PlatformImpl.java:298)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.access$300(WinApplication.java:39)
at com.sun.glass.ui.win.WinApplication$4$1.run(WinApplication.java:112)
at java.lang.Thread.run(Thread.java:744)
Caused by: javafx.fxml.LoadException: 
/C:/Users/Michal/Dropbox/workspace/Java/Feeder%20v%202.0/src/view/main.fxml:59
at javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2617)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2595)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2425)
at com.oracle.javafx.scenebuilder.kit.fxom.FXOMLoader.load(FXOMLoader.java:89)
... 22 more
Caused by: java.io.FileNotFoundException: view\tab\details.fxml (System nie może odnaleźć określonej ścieżki)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(FileInputStream.java:131)
    at java.io.FileInputStream.<init>(FileInputStream.java:87)
    at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
    at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)
    at java.net.URL.openStream(URL.java:1038)
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2440)
    at javafx.fxml.FXMLLoader.access$2500(FXMLLoader.java:104)
    at javafx.fxml.FXMLLoader$IncludeElement.constructValue(FXMLLoader.java:1144)
    at javafx.fxml.FXMLLoader$ValueElement.processStartElement(FXMLLoader.java:740)
    at javafx.fxml.FXMLLoader.processStartElement(FXMLLoader.java:2723)
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2527)
    ... 24 more

SceneBuilder 2.0 is no longer being supported. A company called Gluon is now maintaining it. I've had success with the <fx:include> tag using Gluon's version. Try it:

http://gluonhq.com/labs/scene-builder/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM