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

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

public secondP1(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.blue);  
 Ellipse2D x=new Ellipse2D.Double(100,100,100+10*t,100+10*t); 
 g2.fill(x);
}
     public void run()
     {
        while(true)
        {
	    try {Thread.sleep(1000);}
        catch(InterruptedException e)
        {System.err.println(e.toString());}
	    t++;
	    t=t%10;
        repaint();
        }
    }

}


