I have a number of buttons whose rollover icons are set to be animated gifs.
My first problem was the continuing cpu usage even after the gif was no
longer being displayed.  I dealt with this by overriding imageUpdate() and
returning false at the right time.  I can achieve similar results by
flushing the gif image when the button loses focus.  These were not my ideas
but came from the Java website.

The problem with this approach is that it apparently unloads the images.
I've seen this described by others but I can visually see it also: whenever
an image is loaded it flashes before drawing the successive frames.  Before
putting in the above fix a given image would only flash once then never
again.  Since the fix, it flashes every time the button gets
focus.  I, naively, turned on double buffering on the buttons, and, not to
my surprise, there was no difference.

So this gives rise to a couple of questions: 1)is there some other fix to
the continuing cpu usage problem that does not unload the image; 2)is there
some way to reuse the image such that drawImage() doesn't initially stutter
when drawing?
I'm willing to live with a single initial flash but unwilling to accept a
flash each time the button gets focus.

Admittedly, this is not a Swing-specific problem but it seems like you folks
might know the answer or be able to point me in the right direction.

thanks, rand

--------------------------------
Rand Clark
Software Design Engineer
Transoft Networks
a Hewlett-Packard company
805.883.4315
[EMAIL PROTECTED]
--------------------------------

_______________________________________________
Advanced-swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/advanced-swing

Reply via email to