File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes JOption Pane dead Lock Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JOption Pane dead Lock " Watch "JOption Pane dead Lock " New topic
Author

JOption Pane dead Lock

Bhagya Tangutur
Ranch Hand

Joined: Oct 21, 2002
Posts: 88
What is the Best way to show OptionPane in Multi Threaded Environment.
why I am pointing about Multi Threaded Environment is,Any thread can show Message in OptionPane.So some times there is chance of dead Lock.


Sun Certified Java Programmer
Ken Blair
Ranch Hand

Joined: Jul 15, 2003
Posts: 1078
http://java.sun.com/docs/books/tutorial/uiswing/overview/threads.html
It needs to be done in the event handling thread. If you need to call this from another thread you can create a Runnable and pass it to invokeLater.
Bhagya Tangutur
Ranch Hand

Joined: Oct 21, 2002
Posts: 88
Ken,
That's perfect.It works great now.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JOption Pane dead Lock