1

我是新手java,我正在尝试按照教程JavaFX在 Eclipse 上构建一个应用程序,并且完全相同,该应用程序非常简单,当我尝试编译它时,我得到了一堆我什至没有的错误理解 :e(fx)clipse

Exception in Application start method
Exception in thread "main" java.lang.RuntimeException: Exception in Application start method
    at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:403)
    at com.sun.javafx.application.LauncherImpl.access$000(LauncherImpl.java:47)
    at com.sun.javafx.application.LauncherImpl$1.run(LauncherImpl.java:115)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalStateException: Location is not set.
    at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2021)
    at ch.makery.address.controler.MainApp.start(MainApp.java:29)
    at com.sun.javafx.application.LauncherImpl$5.run(LauncherImpl.java:319)
    at com.sun.javafx.application.PlatformImpl$5.run(PlatformImpl.java:206)
    at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:173)
    at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:29)
    at com.sun.glass.ui.win.WinApplication$2$1.run(WinApplication.java:67)
    ... 1 more

请你能告诉我我错过了什么。

4

1 回答 1

0

You have to set the location of the FXML file in your loader, be sure that you are providing the correct PATH to your FXML file.

PS: Netbeans is the best choice for a JavaFX beginner, start Here.

于 2013-04-23T15:16:37.280 回答