import java.applet.*; import java.awt.Graphics.*; import java.awt.*; import java.awt.event.*; public class Ring extends Applet{ int r, width, height; public void init(){ width=getSize().width; height=getSize().height; } public void paint(Graphics g){ g.setColor(Color.red); for(r=0; r<50; r++){ g.fillOval(width/2-r, height/2-r, 2*r, 2*r); try{ Thread.sleep(50); }catch(InterruptedException e){} } } public static void main(String argumendid[]){ Frame f = new Frame("Pilusilm"); f.setSize(210,210); Applet ap = new Ring(); f.add(ap); ap.setSize(200,200); ap.init(); f.setVisible(true); f.addWindowListener(new WindowAdapter(){ public void windowClosing(WindowEvent e){ System.exit(0); } }); } }