import javax.swing.*;
import java.awt.Graphics;
import java.awt.*;
import java.awt.event.*;
import java.awt.geom.*;

public class secondP extends JPanel implements Runnable
{   
int t;
Thread runner;

public secondP(int t1) 
{t=t1;
 runner=new Thread(this);
 runner.start();
}

public void setP(int t1) {t=t1;}

public void paint(Graphics g)
{
super.paintComponent(g);
Graphics2D g2=(Graphics2D)g;
 g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
 RenderingHints.VALUE_ANTIALIAS_ON);
 g2.setStroke(new BasicStroke(1.0f));
 g2.setColor(Color.black); 
Ellipse2D x=new Ellipse2D.Double(100,100,100,100); 
g2.draw(x);
Line2D x1=new Line2D.Double(150,100,150,200);
g2.draw(x1);
Line2D x2=new Line2D.Double(100,150,200,150);
g2.draw(x2);

double teta=((15-t)*2.0*Math.PI)/60.0;
int xx=(int)(150+50.0*Math.cos(teta));
int yy=(int)(150-50.0*Math.sin(teta));
g2.setColor(Color.blue); 
g2.setStroke(new BasicStroke(2.0f));
Line2D x3=new Line2D.Double(150,150,xx,yy);
g2.draw(x3);

}
     public void run()
     {
        while(true)
        {
	    try {Thread.sleep(1000);}
        catch(InterruptedException e)
        {System.err.println(e.toString());}
	    t++;
        repaint();
        }
    }

}


