The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
May 2000



This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.


It looks like mulithreading was not successful

Posted by Mekala on May 09, 2000 at 9:45 AM

> Hi,
> I'm developing one application, in which when I start downloading
> the information, I want to show its status to user to indicate the
> amount of downloading finished. But I'm facing the problem.
> Here is what I had done :-
> Before I start downloading I starts the thread which is Frame
> and in that I'm displaying JLabel which should update status of
> downloading.I will update this JLabel in the loop as the one after
> one productsInformation is downloaded.
> After thread has been started, I will start downloading proudctsInfo
> in my main thread. But strange thing is that my spawned thread,
> doesn't update the status of downloading. In fact, it doesn't get
> repainted until all downloading is finished. Once it is finished, it
> displays the Frame that was spawned from the main Application.

> Can anybody please guide me in ths ?
> Any code sample will be most appericated .

> regards,
> raju

Have you tried wait() and notify() methods i.e. stopping/allowing the main thread to sleep for a while and repaint the frame in the mean time ?


Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us