import java.applet.Applet; import java.awt.Graphics; import java.awt.*; import java.awt.event.*; import java.awt.TextField; import java.awt.Image; public class mesi3 extends Applet implements Runnable, ActionListener { double nurk=0; double raadius=100; double samm=0.05; boolean veel=true; boolean loodud=false; Image taust, putukas; TextField tf=new TextField("10"); TextField tf2=new TextField(""); int ooteaeg=100; public mesi3(){ add(tf); add(tf2); tf.addActionListener(this); tf2.addActionListener(this); } public void run() { int rx=200, ry=200; double nurk=0; // Thread.sleep(50); while(veel){ int lx=rx+(int)(raadius*Math.cos(nurk)); int ly=ry+(int)(raadius*Math.sin(nurk)); nurk=nurk+0.05; if(taust!=null){ Image pilt2=createImage(getSize().width, getSize().height); Graphics g2=pilt2.getGraphics(); Graphics ekraan=this.getGraphics(); g2.drawImage(taust, 0,0, this); g2.drawImage(putukas, lx, ly, this); ekraan.drawImage(pilt2, 0, 0, this); } try{ Thread.sleep(ooteaeg); } catch(Exception e){e.printStackTrace();} } } public void paint(Graphics ekraan){ taust=createImage(getSize().width, getSize().height); putukas=getImage(getCodeBase(), "sirelane.gif"); Graphics g=taust.getGraphics(); int k=50, a=0, arv=1, rida=1, serv=0, kargi=Integer.parseInt(tf.getText().trim()); int korgus=getSize().height; ekraan.setColor(Color.black); while(a