Prefuse 冻结 JFrame
我们正在调用 Web 服务来收集包含大约 1500 个节点的图的信息。我们在 Prefuse 中显示图形,同时不断添加节点和边。大多数时候,这似乎工作得很好,但每隔一段时间,整个应用程序就会冻结,唯一的恢复方法就是终止应用程序并重新开始。发生这种情况时不会打印出任何异常。在其他情况下,我经常看到“IllegalArgumentException:无效的行索引:-1”,但这似乎与应用程序的冻结无关。
我看到了关于冻结在小程序的相关问题,但是我们的应用程序在 JFrame 中运行,而不是在小程序中运行。以防万一这是我们的问题,我们尝试在代码中的各个位置调用 ActivityManager.stopThread() (找不到 Kill 方法)。这似乎没有太大区别。
prefuse 在编辑图表时是否有线程安全的方式显示图表?
We are calling web services to gather information for a graph with about 1500 nodes. We are displaying the graph in Prefuse while it continually is adding nodes and edges. Most of the time this seems to work great, but every once in awhile the entire app freezes, and the only way to recover is to kill the application and start over. No exceptions are printed out when this happens. On other occasions, I do fairly often see "IllegalArgumentException: Invalid row index: -1", but this doesn't seem to be associated with the freezing of the app.
I saw a related questions about freezing in applets, but our app is running in a JFrame, not an applet. Just in case this was our problem, we tried calling ActivityManager.stopThread() (could not find the kill method) in various places in our code. This doesn't seem to have much if any difference.
Is there a thread safe way for prefuse to display the graph while editing the graph?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对 GUI 的所有更新都必须在 EDT 上完成。使用 SwingWorker。
有关详细信息,请参阅Swing 中的并发性。
All updates to the GUI must be done on the EDT. Use a SwingWorker.
See Concurrency in Swing for more information.