need help with java

was making poker in java for the school project, however, i'm not sure how to add in an animated gif image .. when i add it , it doesnt draw it?
Comments
2
load image with toolkit
public static void main(String[] args) throws MalformedURLException {

URL url = new URL("<URL to your Animated GIF>");
Icon icon = new ImageIcon(url);
JLabel label = new JLabel(icon);

JFrame f = new JFrame("Animation");
f.getContentPane().add(label);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.pack();
f.setLocationRelativeTo(null);
f.setVisible(true);
}

or

http://docs.oracle.com/javase/tutorial/uiswing/components/icon.html#getresource
Back to top