Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Difference between waitForID and waitForAll methods

 
Joshi Amit
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic