JavaFX - java.lang.nullpointer 在一台机器上而不是另一台机器上

JavaFX - java.lang.nullpointer on one machine but not another

我创建了一个显示很少屏幕的 JavaFX Java 程序。 在一台机器上,当我从 eclipse 运行 时它工作,但当我 运行 它作为一个 jar 时失败。 在另一台机器上,它在 eclipse 中失败,出现我之前遇到的相同错误。

我已经链接了包含部分代码以及错误和文件夹布局的屏幕截图。

如有任何帮助,我们将不胜感激。

screenshot containing part of the code and also the error and folder layout

您尝试使用的 fxml 文件似乎名为 MainForm.fxml。但是在第 14 行,您正在尝试使用 Mainform.fxml。尝试将表格中的 'F' 大写。