If you set a gif in an ImageIcon, it will stay static and only show you one frame. For a gif to show animated, you have to asign an ImageObserver(JLabel implements ImageObserver)
ImageIcon i = new ImageIcon(new File("image");
JLabel thumbnail=new JLabel();
thumbnail.setIcon(i);
if(s.toLowerCase().endsWith(".gif")){
i.setImageObserver(thumbnail);
}
No hay comentarios:
Publicar un comentario