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

public class sliderP extends JPanel implements ChangeListener
{
    // 
    private ovalP p;
    private JSlider cap;
    Color r=Color.lightGray;
    // pencereyi baslatma metodu
    public sliderP()
    {
	this.setLayout(new BorderLayout());
    p=new ovalP(30,30,30);
    cap=new JSlider(SwingConstants.HORIZONTAL,0,200,10);
    cap.setMajorTickSpacing(20);
    cap.setPaintTicks(true);
    cap.setPaintLabels(true);
    cap.addChangeListener(this);
    add(p,BorderLayout.CENTER);
    add(cap,BorderLayout.SOUTH);
    }
    // girdi alanindaki olan olaylari dinleme metodu
    public void stateChanged(ChangeEvent e)
    {
     p.setOvalP(30, 30,cap.getValue());
     repaint();
    }

     //=====================================================
      public static void main(String[] args)
      {
      SliderTest f= new SliderTest();
      f.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
      f.setSize(500,500);
      f.setVisible(true);
      }
}
