aspose file tools*
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
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Bug: IconUIResource doesn Watch "Bug: IconUIResource doesn New topic
Author

Bug: IconUIResource doesn't paint an animated ImageIcon

Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4527
    
    5

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.
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4215118
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4215118


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.

edit http://forums.sun.com/thread.jspa?threadID=5441460
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Bug: IconUIResource doesn't paint an animated ImageIcon