当我通过IDE(IntelliJ)运行它时,我的应用程序工作正常但我在运行构建的工件时遇到问题。场景不会像在IDE中那样改变。此问题仅影响我目前拥有的5个场景中的1个。问题在于ViewCustomers场景。
初始场景的控制器类的相关部分。
// $(document).ready( main() );
$(document).ready( main );
编辑:从命令提示符运行时出现异常
// This one works
@FXML
public void viewBranches() throws IOException {
stage=(Stage) menuBar.getScene().getWindow();
Parent root = FXMLLoader.load(getClass().getResource("ViewBranches.fxml"));
Scene scene = new Scene(root, 800, 500);
stage.setTitle("Banking - Branches");
stage.setScene(scene);
stage.show();
}
// This one doesn't work
@FXML
public void viewCustomers()throws IOException{
DecisionBox.oneOption("Title", "Some text."); //Serves as a confirmation that the method runs
stage=(Stage) menuBar.getScene().getWindow();
Parent root = FXMLLoader.load(getClass().getResource("ViewCustomers.fxml"));
Scene scene = new Scene(root, 800, 500);
stage.setTitle("Banking - Customers");
stage.setScene(scene);
stage.show();
}