import java.applet.*; import java.awt.*; public class Ruum1 extends Applet implements Runnable{ double nurk=0; double nurgasamm=0.05; double raadius=50; int keskx=100; int kesky=100; public Ruum1(){new Thread(this).start();} void liigu(){ nurk=nurk+nurgasamm; } void joonista(Graphics g){ int x=keskx+(int)(raadius*Math.cos(nurk)); int y=kesky-(int)(raadius*Math.sin(nurk)); g.drawOval(x-5, y-5, 10, 10); } public void run(){ while(true){ try{ Graphics g=getGraphics(); liigu(); g.setColor(Color.black); joonista(g); Thread.sleep(300); g.setColor(getBackground()); joonista(g); }catch(Exception e){} } } public static void main(String arg[]){ Frame f=new Frame(); f.add(new Ruum1()); f.setSize(200, 200); f.setVisible(true); } }