import java.applet.Applet; import java.awt.*; public class l1 extends Applet implements Runnable{ Image pilt, sahver; Graphics piltg, sahverg; Thread tr=null; int koht=0, pikkus=500, korgus=500; int kohtx[]={1, 3, 5, 7, 9, 12, 14, 15, 16, 16, 17, 18, 18, 19, 19, 20, 20, 20, 20, 20 }; Color varvid[]=new Color[5]; public void init(){ varvid[0]=Color.red; varvid[1]=Color.green; varvid[2]=Color.blue; varvid[3]=Color.black; pilt=createImage(pikkus, korgus); sahver=createImage(pikkus, korgus); piltg=pilt.getGraphics(); sahverg=sahver.getGraphics(); a1(); } public void start(){ if (tr==null)tr=new Thread(this); tr.start(); } public void stop(){tr=null;} public void run(){ while(tr!=null){ edasi(); try{ tr.sleep(100);} catch(Exception e){} if(koht%20==1)try{tr.sleep(1000);}catch(Exception e){} } } public void joonistaL(int arv, Graphics g, int x, int y){ for(int i=0; i=60){koht=0; try{tr.sleep(5000);}catch(Exception e){}} } public void paint(Graphics g){ g.drawImage(pilt, 0, 0, this); } public void update(Graphics g){paint(g);} }