File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Difference between waitForID and waitForAll methods" Watch "Difference between waitForID and waitForAll methods" New topic
Author

Difference between waitForID and waitForAll methods

Joshi Amit
Greenhorn

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.

regards,
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