Slick2d Game Engine Animation Example

Using the Slick2d game engine there are multiple ways of creating animations.
The following examples will do the same exact thing, but its two different ways of writing it.

Imports
import org.newdawn.slick.Animation;
import org.newdawn.slick.SpriteSheet;

Example 1
SpriteSheet runningSS = new SpriteSheet("/path/to/sprite.png", 24, 32);
Animation runningAnimation = new Animation();
runningAnimation.setAutoUpdate(true);
runningAnimation.addFrame(runningSS.getSprite(0, 0), 100);
runningAnimation.addFrame(runningSS.getSprite(1, 0), 100);
runningAnimation.addFrame(runningSS.getSprite(2, 0), 100);

runningSS.getSprite(1, 0) is not the pixel value, but the sprite location if the whole image were broken up into cells based on the width and height defined when creating the sprite sheet

Example 2
SpriteSheet runningSS = new SpriteSheet("/path/to/sprite.png", 24, 32);
Animation runningAnimation = new Animation(runningSS, new int[]{0,0,1,0,2,0}, new int[]{100,100,100});

This example is for slick build 274