Last week I posted about a problem I was having doing the following:
A modal dialog shows some options and then based on those selections, a
system print or system save file dialog opens.
The problem I had was that irregularly but frequently the system print
or system save dialog would simply flash on the screen and then
disappear, without allowing the user to either print or save the data.
A post on August 19th regarding "Modal dialog problems" by Peter
Richterich suggested a solution for a similar problem with custom
dialogs, where he created a SafeJDialog class that extends JDialog, but
imposes a delay before and after calling dispose(). Then he used that
class as the base class for his custom dialogs. He reported that a
delay of > 20 ms seemed sufficient to solve his problem.
Since I was using system dialogs, I couldn't use this solution
directly. Instead, I simply put in a call to Thread.sleep(40)
immediately before I tried to open the save or print dialog. This
seems to have solved the problem.
Thanks, Greg, for pointing me towards this solution.
Cheers!
Pam
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden