import java.awt.*; public class Piston extends java.applet.Applet{ Image pvtpics[] = new Image[14]; Image currentimg; Thread runner; int xpos = 125; int ypos=50; int i=0; public void init() { String pvtsrc[] = {"pistm1.gif", "pistm2.gif", "pistm3.gif", "pistm4.gif", "pistm5.gif", "pistm6.gif", "pistm7.gif", "pistm8.gif", "pistm9.gif", "pistm10.gif", "pistm11.gif", "pistm12.gif", "pistm13.gif", "pistm14.gif"}; for (int i=0; i13) i=13; currentimg=pvtpics[i];} if(bname.equals("remove heat")){ i=i-1; if(i<0) i=0; currentimg=pvtpics[i];} repaint(); } public void paint(Graphics g) { if (currentimg != null) g.drawImage(currentimg, xpos, ypos, this); } }