I am using JDK 1.2 and am trying to program an applet to perform an recursive loop so that it calls various jpg files and displays them continuously looping in the applet. I have created a list of jpgs from which a picture is called, and then displayed in the paint method.
I have two problems: 1stly my code does not work. It only appears to display the 1st image.
Secondly I wish to incorporate double buffering into the code so that the applet becomes flicker free.
Here is my current code. Please suggest any modifications to achieve the above. I can only really give the points to a solution that solves both these problems and explains them. Thank you very much, I look forward to reading any solutions anyone has.
public class anim1 extends Applet
int pic_counter =1;
public void init()
imagelist = new Image ;
for (int i = 0; i < 4; i++)
imagelist[i] = getImage(getCodeBase(), "George"+pic_counter+".jpg");
public void paint(Graphics g)
g.drawImage(imagelist[i], 50, 100, this);
Since I'm offering 200 points for what to an expert would be a trivial problem can I please have modifications made to my code! Thanks !!!