This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 130050 - Animated GIFs are not animated
Summary: Animated GIFs are not animated
Status: RESOLVED WONTFIX
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P4 blocker (vote)
Assignee: issues@guibuilder
URL:
Keywords:
: 179691 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-03-13 15:33 UTC by Jan Stola
Modified: 2010-01-21 05:43 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Stola 2008-03-13 15:33:23 UTC
Try to assign an animated GIF to some label or button. The GIF will not be animated in the design time. It will be 
animated in run-time only.
Comment 1 Jan Stola 2008-03-13 15:39:52 UTC
There are (at least) 2 reasons why the icon is not animated.

The first reason is usage of ImageIO.read() in IconEditor. Usage of this method avoids unneeded caching (see issue 
110609 for a test-case). This method returns icons that are not animated. Compare
    label.setIcon(new ImageIcon(ImageIO.read(new java.net.URL(url))));
with
    label.setIcon(new ImageIcon(new java.net.URL(url)));

The second reason is in the way how are ImageIcons serialized (e.g. cloned from model to view). When an ImageIcon for 
animated GIF is serialized and restored then in becomes static (e.g. not animated). Try

    ImageIcon icon = new ImageIcon(new java.net.URL(url));
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    ObjectOutputStream oos = new ObjectOutputStream(bos);
    oos.writeObject(icon);
    oos.close();
    icon = (ImageIcon)new ObjectInputStream(new ByteArrayInputStream(bos.toByteArray())).readObject();
    label.setIcon(icon);

Hence, it is not worth the effort to fix this issue.
Comment 2 Jan Stola 2010-01-21 05:43:55 UTC
*** Bug 179691 has been marked as a duplicate of this bug. ***