简体   繁体   English

预熔冻结JFrame

[英]Prefuse freezes JFrame

We are calling web services to gather information for a graph with about 1500 nodes. 我们正在调用Web服务来收集大约1500个节点的图形的信息。 We are displaying the graph in Prefuse while it continually is adding nodes and edges. 我们在连续添加节点和边的同时在Prefuse中显示图形。 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. 在其他情况下,我经常看到“ IllegalArgumentException:无效的行索引:-1”,但这似乎与冻结应用程序无关。

I saw a related questions about freezing in applets , but our app is running in a JFrame, not an applet. 我看到了有关冻结applet的相关问题,但是我们的应用程序运行在JFrame中,而不是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. 以防万一这是我们的问题,我们尝试在代码的各个位置调用ActivityManager.stopThread()(找不到kill方法)。 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? 有没有一种线程安全的方法来编辑在编辑图形时显示图形?

Is there a thread safe way to display the graph while editing the graph? 在编辑图形时,有没有一种线程安全的方式来显示图形?

All updates to the GUI must be done on the EDT. GUI的所有更新必须在EDT上完成。 Use a SwingWorker. 使用SwingWorker。

See Concurrency in Swing for more information. 有关更多信息,请参见Swing中的并发

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM