HelpJava Applet rotating a circle around a oval

Posts 14 of 4 · Page 1 of 1
Java Applet rotating a circle around a oval
Hi,

Could anyone help me rotate this circle around the oval? Or could anyone tell me where i should start?

Code:
import java.awt.*;
import java.applet.*;


public class Rotate extends Applet implements Runnable {
    
    
    public void init() {
        
    }
    
    public void start() {
        
        Thread t = new Thread(this);
        t.start();
        
    }
    
    public void run() {
        
        Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
        while (true){
            
            repaint();
            try {
                Thread.sleep(500);
            }
            catch (InterruptedException e) {
                //Do Nothing
            }
            Thread.currentThread().setPriority(Thread.MAX_PRIORITY); 
        }
    	
    }
        
    public void paint(Graphics g) {
    g.drawOval(75,20,150,115);
    g.fillOval(90,25,20,20);
    
    
    }

}
Sorry for double posting (Can't seem to find the edit button anymore for some reason)

Er.. by rotate i meant move around the outline of the oval.

If anyone knows how please reply soon as this is a urgent problem (assignment) because apparently my java teacher went on leave for a few weeks now for unknown reason so we had a sub teacher which doesn't know anything about java apparently and called us to figure it out ourself.

Any help would be greatly appreciated.
Nvm, done it.

Mods can close this thread now
If you've succeeded in your problem, please add the solution for others with the same problem to see
(I don't need that for now, but others might)
Posts 14 of 4 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?