I've got a problem I think with the Java AWT engine, not my code....
Now before you shout "DON'T USE AWT USE SWING.. " I can't I'm utilising Java3D and the Canvas3D object does not like to sit alongside Swing, while it's happy to sit along side AWT Components.
My problem is I have a panel with an image on it. The panel has a mouse listener and when I click the panel it alters to an alternate image, a little like an ImageButton..... however this is the panel background, not the foreground componets.
Anyway, the problem is the Image initially (for the first 3 clicks/exchanges) flashes... as if it's held in a slower part or heap location until it's been used n many times.
Is this the case? does it take time to cache the image into the AWT Heap or Graphics memory? I'm a little bemused by the background rendering involvd in the AWT.
The image is loaded as a bulk read of a file stream, to a byte array.. then I use the Toolkit.creatImage... To give me an Image object from the raw bytes. This action is seamless and does not lag like the getImage function. I have checked this, and it would seem no MediaTracker is required.... but if I''m wrong let me know... though I doubt I am incorrect on this point.