Ranchers,
I always thought when it comes to Threads: implementing Runnable is flexible and advantageous over Extending
Thread. However I'm encountering a peculiar problem. Could you please suggest alternatives, get-arounds or solutions:
Here's the scenario:
I have a Dialog where in user asks for some Tasks(each implemented by a sepearte Thread)
Now here's what i do:
1> Close the dialog (SwingUtilities.invokeLater (Runnable(closeDialog));
2> In a loop : do the tasks sequentially using 2 threads: 1 actually does the work; 2nd checks for status of the task; I add both of them to a Hashtable
3> Use a Monitor implementing Runnbale... check the Hashtable; get The threads; join() each of them; at the end refreah the screen
When Monitor is extended as a thread then I'm able to achieve the synchronization; but when Monitor is implemented as a thread then screen is unresponsive until tasks are completed.
What am I missing when Monitor is implemented from Runnable? WIll making Monitor extend from a thread have other impacts?
Please let me know
Ravi