This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Making JOptionPane disappear after Ok is pressed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Making JOptionPane disappear after Ok is pressed" Watch "Making JOptionPane disappear after Ok is pressed" New topic
Author

Making JOptionPane disappear after Ok is pressed

Barry Brashear
Ranch Hand

Joined: Jun 05, 2001
Posts: 303
I have a situation where I'm opening a JOptionPane with a warning message
and then some processing occur after the ok button is clicked. What's happening is the JOptionPane appears frozen with OK button pressed until
after the processing completes. How can I make sure the JOptionPane disappears afte the ok button is pressed?

Thanks.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

You're probably doing this processing right in an event handler, which ties up the event-handing thread and blocks any screen updates until the processing is over. Any time you do any nontrivial computation in a GUI app, you should create a new Thread and do the computation in that Thread, freeing up the event thread to do things like make JOptionPanes disappear.


[Jess in Action][AskingGoodQuestions]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Making JOptionPane disappear after Ok is pressed
 
Similar Threads
JOptionPane.showMessageDialog()
JOptionPane buttons
Message Dialog box --> action performed.
multiple clicks required to close JOptionPane
How to bring user back to the internalframe after JOptionPane?