*/
public static boolean writeGif(String targetFile,
String[] frameFiles,
int delay) {
try {
AnimatedGifEncoder e = new AnimatedGifEncoder();
e.setRepeat(0);
e.start(targetFile);
for (String f : frameFiles) {
e.setDelay(delay);
e.addFrame(ImageIO.read(new File(f)));
}
return e.finish();
}
catch (Exception e) {
return false;
}
}