Win a copy of Penetration Testing Basics this week in the Security forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Bug: IconUIResource doesn't paint an animated ImageIcon

Darryl Burke
Posts: 5148
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic