• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to finish loading the program before start()

 
Weronpc
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My friend wrote an Applet that contains thread, I think Applet does this automatically: Make sure everything load befor running the thread.

But my programming is not an Applet, when I start my program, the thread will run before the program finish loading. Is there a way to fix this problem?

Thanx
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24213
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'd have to define "loading" for me before I could offer any advice. The answer, though, will be that you just have to not start your threads until the "loading" is completed -- simple enough.
 
Weronpc
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
loading = load all images on screen before repaint again.
 
Alexandru Popescu
Ranch Hand
Posts: 995
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you mean that you try to load some images in a separate thread, ain't it?
So the main thread should wait() for the thread loading the images.

./pope
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to observe the images using a MediaTracker, as far as I know.
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24213
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, indeed. MediaTracker will handle this nicely.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!