Cargando gif animado de archivo JAR en ImageIcon

Estoy intentando crear un ImageIcon a partir de un gif animado almacenado en un archivo jar.

ImageIcon imageIcon = new ImageIcon(ImageIO.read(MyClass.class.getClassLoader().getResourceAsStream("animated.gif")));

La imagen se carga, pero solo el primer cuadro del gif animado. La animación no se reproduce.

Si cargo el gif animado de un archivo en el sistema de archivos, todo funciona como se espera. La animación se reproduce a través de todos los cuadros. Así que esto funciona:

ImageIcon imageIcon = new ImageIcon("/path/on/filesystem/animated.gif");

¿Cómo puedo cargar un gif animado en un ImageIcon desde un archivo jar?

EDITAR: Aquí hay un caso de prueba completo, ¿por qué esto no muestra la animación?

import javax.imageio.ImageIO;
import javax.swing.*;

public class AnimationTest extends JFrame {

    public static void main(String[] args) {
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                AnimationTest test = new AnimationTest();
                test.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                test.setVisible(true);
            }
        });
    }

    public AnimationTest() {
        super();
        try {
            JLabel label = new JLabel();
            ImageIcon imageIcon = new ImageIcon(ImageIO.read(AnimationTest.class.getClassLoader().getResourceAsStream("animated.gif")));
            label.setIcon(imageIcon);
            imageIcon.setImageObserver(label);
            add(label);
            pack();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

Respuestas a la pregunta(4)

Su respuesta a la pregunta