我正在尝试将视频放到窗格中,但是我有一个例外,但是我找不到来自何处的视频。
public class project extends Application {
@Override
public void start(Stage stage) throws Exception {
Parent root = FXMLLoader.load(getClass().getResource("/fxml/OnBoard.fxml"));
Scene scene = new Scene(root);
stage.setScene(scene);
stage.show();
}
public static void main(String[] args) {
launch(args);
}
这是控制台错误
Exception in Application start method
Caused by: javafx.fxml.LoadException:
file:/C:/Users/Robin/Documents/NetBeansProjects/Project/dist/run586216440/Project.jar!/fxml/OnBoard.fxml
at javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2601)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2579)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2441)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3214)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3175)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3148)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3124)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3104)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:3097)
at fxml.project.start(project.java:25)
Caused by: java.lang.NullPointerException
at controllers.HomeController.initialize(HomeController.java:87)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2548)
它说第25行有问题,但我找不到它,链接似乎很好。