Forums Register Login

retrieving event dispatch thread

+Pie Number of slices to send: Send
Hi Java Ranchers!

I have two threads. The first one compute some tasks and after that it call Event Dispatch Thread to present that task. Event Dispatch Thread do it, but the computations thread do another computations and Event Dispatch Thread is too slow to present the data.



I want to wait for the Event Dispatch Thread and then perform some computation. There is join() function, but how can I get a referece to the Event Dispatch Thread?
+Pie Number of slices to send: Send
Use a Swing Worker.
+Pie Number of slices to send: Send
You definitely do not want to join on the EDT; it won't stop when your Runnable is finished.

If you can't use SwingWorker you can try EventQueue.invokeAndWait. This blocks until your Runnable has ended (and therefore cannot be run from the EDT itself or it's a 100% guaranteed deadlock).
He puts the "turd" in "saturday". Speaking of which, have you smelled this tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1639 times.
Similar Threads
What is/the point of, a secure thread?
Waiting the Event-Dispatch thread
Event Dispatch Thread
Correct use of threads?
Why InvokeLater
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 15:44:36.