开发者

Closing a JOptionPane Causes a Deadlock in Java Swing

开发者 https://www.devze.com 2023-04-13 06:48 出处:网络
I have an application which开发者_开发知识库 runs OK at most sites.But one site, which is hosting the application on a Citrix Box appears to have a deadlock problem.I ran a profiler on the session and

I have an application which开发者_开发知识库 runs OK at most sites. But one site, which is hosting the application on a Citrix Box appears to have a deadlock problem. I ran a profiler on the session and received a surprise. The statement causing the deadlock appears to be a statement which closes a JOptionPane dialogue box. Please see the enclosed display.

So I have three questions:

  1. Is my interpretation correct?
  2. Any idea of why this can happen.
  3. What can I do in code to prevent this from occurring?

Thank you in advance for your help.

Elliott

Closing a JOptionPane Causes a Deadlock in Java Swing


Swing is not thread-safe. Perhaps your app is calling Swing GUI methods from outside of the Event Dispatch Thread.

If you can reduce this to a minimal sample that still reproduces the problem, you will either 1) find the cause yourself in the process, or otherwise 2) end up with a much greater chance of getting help from someone else.


  1. Don't know, but if it is..
  2. Calling GUI methods (update the GUI) off the EDT.
  3. Call GUI methods on the EDT.
0

精彩评论

暂无评论...
验证码 换一张
取 消