I'm trying to get a gif to restart from the start midway through its animation when a button is pressed. How do I do this?
I've tried these methods:
lblDeath.setIcon(new ImageIcon(MainGame.class.getResource("/azzets/blank.png")));
lblDeath.setIcon(new ImageIcon(MainGame.class.getResource("/azzets/3 Seconds.gif")));
lblDeath.setVisible(false);
lblDeath.setIcon(new ImageIcon(MainGame.class.getResource("/azzets/3 Seconds.gif")));
lblDeath.setVisible(true);
(3 seconds gif is the one I'm trying to get to restart)
Thanks.