File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes Bug: IconUIResource doesn't paint an animated ImageIcon Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Bug: IconUIResource doesn Watch "Bug: IconUIResource doesn New topic

Bug: IconUIResource doesn't paint an animated ImageIcon

Darryl Burke

Joined: May 03, 2008
Posts: 5115

I was recently playing with Icons and found that javax.swing.plaf.IconUIResource doesn't paint an ImageIcon that contains an animated GIF. Found the reason in these bug fixes.

From that, I could arrive at a workaround: extend ImageIcon to implement the UIResource marker interface and use this class instead of wrapping an ImageIcon in a IconUIResource. Interestingly, NetBeans autocomplete revealed the existance of sun.swing.ImageIconUIResource which I determined to be a direct subclass of ImageIcon, with two constructors that take an Image and byte[] respectively.

Test SSCCE: I can't see any alternative fix for the one carried out in response to the quoted bug reports, so have held off on making a bug report. Any ideas?

Thanks for reading, Darryl

I'm also posting this to the Sun / Oracle forums for wider discussion, and shall post the link here as soon as possible. I'll also keep both threads updated with all significant suggestions received.

I agree. Here's the link:
subject: Bug: IconUIResource doesn't paint an animated ImageIcon
It's not a secret anymore!