I am trying to display an ImageIcon (an animated .gif image file) on my canvas in Java. When I draw the ImageIcon like this:
this.character = new ImageIcon("resources/test.gif");
public void render(Point position, GuiComponent gui, Container observer) {
Graphics graphics = gui.getGraphics();
character.paintIcon(observer, graphics, position.x, position.y);
}
the gif only loops once, while I would like to get my gif loop indefinitely. Does anyone know how to do this?