JavaFX测试在NetBeans中运行失败。

huangapple 未分类评论44阅读模式
英文:

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 方法内 JavaFX测试在NetBeans中运行失败。 但我想知道为什么捕获块没有抛出任何异常。

英文:

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 JavaFX测试在NetBeans中运行失败。 but i wonder why the catch block didn't throw any exceptions.

huangapple
  • 本文由 发表于 2020年4月3日 20:51:23
  • 转载请务必保留本文链接:https://java.coder-hub.com/61012332.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定