Meaningless Drivel is fun!
The moose likes Swing / AWT / SWT and the fly likes Difference between waitForID and waitForAll methods Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Difference between waitForID and waitForAll methods" Watch "Difference between waitForID and waitForAll methods" New topic

Difference between waitForID and waitForAll methods

Joshi Amit

Joined: Oct 03, 2004
Posts: 2
hi all,

I want to know what is the difference between waitForID() and waitForAll() methods of the MediaTracker class.

Tell me exactly what happens when we call one of these methods.
Whether does is download the images or not?

If possible give explaination of this with an example for clear idea.

Amit Joshi
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
To learn exactly what MediaTracker does when you call its methods you can look up the methods in the MediaTracker api and read about them in the Method Detail section and/or look in the MediaTracker source code available in your sdk <JAVA_HOME>src/java/awt (after you unzip the src folder, of course).

I made up a small app to show what happens when you load with each method. You can experiment with it to learn how things work.

If you enjoy these things you can also experiment with the ImageObserver interface which is implemented by all Components. So all you need to do is override the imageUpdate method within your image–loading component and you have access to the loading process via flags described in the ImageObserver api.
It is sorta covered in the JavaRanch Style Guide.
subject: Difference between waitForID and waitForAll methods
It's not a secret anymore!