Media Tracker and inheritance question

I was wondering that if I have an engine with different types of tiles that all inherit from a tyle class and I wish to use Media Tracker to load them, should I have the Media tracker loading method in the tile class and then have each subclass inherit the method and call it? or should each sub class have its own media tracker method?

I know it’s not the kind of answer you’re looking for, but please, do not use ImageTracker. It’s a very old 1.1 interface, we can’t wait when it dies.

Take a look at javax.imageio instead…

What is wrong with using MediaTracker and how is javax.imageio better?

MediaTracker was written a long time ago, contains a bunch of badly synchronized code and is prone to deadlocks.
It’s not only MediaTracker, but all of the legacy Toolkit image loading code is the problem.

ImageIO allows you much more control, is extensible, pluggable. For example, not long ago a new version of Java AdvancedImaging was released, which contains decoders for many new image formats.

I assume there is work being done to recode the old routines with ImageIO so we don’t have all that baggage…And we get the ability to use new image formats easily with existing APIs like:

new ImageIcon(“IWantATargaHere.tga”);

As well as getting ImageIO images accelerated etc…

That sort of consolidation and cleanup would be most welcome.