On Dec 23, 2004, at 12:28 PM, Nicholas R. Rinard wrote:
With hindsight, I can describe my problem as having trouble getting
the PM to pop up fast enough. Indeed, I set it to come up after two
milliseconds, so why (I wondered) did it take five or ten seconds to
actually appear? I still don't have the answer, but Werner's tip to
set the pop-up-time to zero milliseconds worked, and the PM now
appears right as my thread is spawned, as I wanted.
My understanding is that the PM calculates the "rate of progress" every
time (and only when) setProgress(int i) is called. If you call
setProgress and the "MillisToDecideToPopup" time has not elasped, it
does nothing. If this time has elapsed, it estimates the remaining
time to complete the task. If this estimated time to completion is
longer than "MillisToPopup" the PM is displayed. The gotcha here is
that if you call "setProgress(1)" right after constructing the PM
(without doing at least 1 millisecond of work), then the elasped time
could be very small (possible zero millis) and thus the estimated time
to completion would also be very quick. This might trick the PM into
thinking that it would not need to popup. Here's the code I use to get
the PM to show immediately:
I started reading this thread in the middle, so sorry if anything's
repeated.
~Todd Jenkins
_______________________________________________
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