import java.awt.*;
import java.applet.Applet;

public class Ring extends Applet{
public void paint(Graphics g){



for(int i=0;i<10;i++){
for(int x=25;x<350;x=x+10){
g.setColor(Color.black);
g.drawOval(x,90,20,20);
try{Thread.sleep(50);}catch(Exception e){}
g.setColor(Color.white);
g.drawOval(x,90,20,20);
}
for(int x=350;x>10;x=x-10){
g.setColor(Color.black);
g.drawOval(x,90,20,20);
try{Thread.sleep(50);}catch(Exception e){}
g.setColor(Color.white);
g.drawOval(x,90,20,20);
}
}



}
public static void main(String argumendid[]){
Frame f=new Frame("Kaldpind");
f.setSize(400,400);
f.add(new Ring());
f.setVisible(true);
}
}