import java.applet.Applet; import java.awt.*; import java.awt.event.*; public class Uss1 extends Applet implements ActionListener{ int nr=20; int arv=1; TextField tf1=new TextField("1"); public Uss1(){ add(tf1); tf1.addActionListener(this); } public void actionPerformed(ActionEvent e){ arv=Integer.parseInt(tf1.getText()); repaint(); } public void paint(Graphics g){ int a=0; int x=10, y=200; int m=200; int b=-70; int v=10; int c=0; int l=0; while (c<16){ try{Thread.sleep(100/arv);}catch(Exception e){} g.setColor(Color.black); g.fillOval(v, y, nr, nr); g.setColor(Color.green); g.fillOval(b, m, nr, nr); b=b+nr; v=v+nr; c=c+1; l=l+1; if (l==4){ y=y-10; } if (l==8){ m=m-10; l=l-8; } } } public static void main(String argumendid[]){ Frame f=new Frame("Ussisuss"); f.setSize(500, 400); f.setBackground(Color.green); f.add(new Uss1()); f.setVisible(true); } }