import java.applet.Applet; import java.awt.*; public class LiikuvRing extends Applet{ public void paint(Graphics g){ for(int x=40; x<240; x=x+2){ g.setColor(Color.black); //joonistatakse must ring g.drawOval(x, 90, 20, 20); try{Thread.sleep(50);}catch(Exception e){} //oodatakse veidi g.setColor(Color.white); //ning kustutatakse see g.drawOval(x, 90, 20, 20); //valgega üle joonistades } } }