import java.applet.Applet; import java.awt.*; public class LiikuvRing extends Applet{ public void paint(Graphics g){ g.setColor(Color.red); //joonistatakse punane ring g.drawOval(90, 90, 20, 20); g.fillOval(90, 90, 20, 20); try{Thread.sleep(3600);}catch(Exception e){} //oodatakse veidi g.setColor(Color.white); g.drawOval(90, 90, 20, 20); g.fillOval(90, 90, 20, 20); try{Thread.sleep(360);}catch(Exception e){} //oodatakse veidi g.setColor(Color.yellow); g.drawOval(90, 100, 20, 20); g.fillOval(90, 100, 20, 20); try{Thread.sleep(3600);}catch(Exception e){} //oodatakse veidi g.setColor(Color.white); g.drawOval(90, 100, 20, 20); g.fillOval(90, 100, 20, 20); try{Thread.sleep(360);}catch(Exception e){} //oodatakse veidi g.setColor(Color.green); g.drawOval(90, 150, 20, 20); g.fillOval(90, 150, 20, 20); try{Thread.sleep(3600);}catch(Exception e){} //oodatakse veidi g.setColor(Color.white); g.drawOval(90, 150, 20, 20); g.fillOval(90, 150, 20, 20); } }