import java.applet.Applet; import java.awt.*; public class Tolm1 extends Applet{ public void paint(Graphics g){ for(int y=40; y<240; y=y+2){ for(int x=40; x<44; x=x+2){ g.setColor(Color.black); //joonistatakse must ring g.drawOval(x, y, 20, 20); try{Thread.sleep(50);}catch(Exception e){} //oodatakse veidi g.setColor(Color.white); //ning kustutatakse see g.drawOval(x, y, 20, 20); //valgega üle joonistades } } } public static void main(String[] argumendid){ Frame f=new Frame(); f.add(new Tolm1()); f.setSize(300, 300); f.setVisible(true); } } // for(int z=240; z>40; z=z-2){ // g.setColor(Color.black); //joonistatakse must ring // g.drawOval(z, 90, 20,20); //try{Thread.sleep(50);}catch(Exception e){} //oodatakse veidi //g.setColor(Color.white); //ning kustutatakse see //g.drawOval(z, 90, 20, 20); //}