NSWindow 拖动区域应该只在主线程上无效

问题描述

我在我的 Mac(带有 macOS Big Sur)上使用 Repast Simphony 2.7.0 和来自采用 Open JDK 的 Java 8 (v. 275) JDK。当我从 Eclipse 启动任何模型时,我会正确地看到 Repast Simphony UI,但是如果我单击“初始化运行”按钮,应用程序崩溃并出现以下错误

java[58047:1430399] Apple AWT Internal Exception: NSWindow drag regions should only be invalidated on the Main Thread!
java[58047:1430399] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException',reason: 'NSWindow drag regions should only be invalidated on the Main Thread!'

我检查了 Eclipse 首选项,选择了正确的 JRE。 要重现问题,只需使用 Repast Simphony 提供的任何示例(例如我使用 Zombies_Demo)并启动模型。不需要补充代码

我还尝试使用较旧的 JRE(Java SE 1.8.0_91),在这种情况下,单击“初始化运行”只会引发警告,并且我可以成功执行我的模型。警告是:

WARNING: NSWindow drag regions should only be invalidated on the Main Thread! This will throw an exception in the future.

我需要使用安装程序分发模型,因此所需的行为是使模型适用于 Java 8 的每个次要版本。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)