import java.awt.*; public class Liigu3 extends Frame implements Runnable{ double nurk=0; double raadius=50; double samm=0.01; int ooteaeg=10; //ms boolean veel=true; public Liigu3(){ super("Ringike"); setSize(300, 300); setVisible(true); new Thread(this).start(); } public void joonista(){ Graphics g=this.getGraphics(); g.setColor(Color.white); g.fillRect(0, 0, getSize().width, getSize().height); int keskx=getSize().width/2; int kesky=getSize().height/2; g.setColor(Color.black); g.drawOval( keskx+(int)(raadius*Math.cos(nurk))-5, kesky+(int)(raadius*Math.sin(nurk))-5, 10, 10 ); nurk=nurk+samm; if(nurk>2*Math.PI)nurk-=2*Math.PI; } public void run(){ while(veel){ joonista(); try{ Thread.sleep(ooteaeg); } catch(Exception e){e.printStackTrace();} } } public static void main(String argumendid[]){ new Liigu3(); } }