英文:
javafx test run fail in netbeans
问题
我在一周前开始使用JavaFX框架开发一个应用,并通过在Netbeans 11.0上的win10上运行项目(简单的F6“运行项目”)进行了测试。
一切都很顺利,直到今天我添加了一个新的FXML和与之相关的数据库代码。项目成功编译,但当它(Netbeans或我)执行jar文件时,出现了奇怪的情况!任务栏中出现一个空的图标,并且笔记本电脑的风扇速度增加。
我确定我的代码有问题,但我无法确定是哪部分出错。有谁能帮我建议一个实时调试工具,以便我可以知道崩溃的源头?
英文:
i started to develop an app with javafx framework a week ago and i tested it by running the project (simple F6 "Project Run" in Netbeans 11.0 on win10).
everything was fine until today when i added a new FXML and database codes related to it. the project compiles successfully but when it (netbeans or me) executes the jar file, things get weird! one empty icon shows up in taskbar and laptop fan speed increases.
i'm sure sth is wrong with my code but i can't know which part. can anyone help me with suggesting a realtime debugger so i can know the source of crash?
答案1
得分: 0
我最终找到了答案。这是一个尝试和捕获块,尝试加载一个无法加载的 fxml 文件,并且我将这个块写在 initialize 方法内 但我想知道为什么捕获块没有抛出任何异常。
英文:
i found the answer eventually. it was a try and catch block which was trying to load an fxml which couldn't be loaded and i wrote this block inside initialize method but i wonder why the catch block didn't throw any exceptions.
专注分享java语言的经验与见解,让所有开发者获益!
评论