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

public class  buttonP extends JPanel implements ActionListener
{ 
  JButton b;
  starP d;
  public buttonP()
  {    	
       setLayout(new BorderLayout());     
       d=new starP();
       d.setFill();
       b=new JButton("Push button to change between draw and fill");
       b.addActionListener(this);
       add(b,BorderLayout.NORTH);
       add(d,BorderLayout.CENTER); 
  }
  
  public void actionPerformed( ActionEvent e)
  {
  if(d.fill) d.setDraw();
  else       d.setFill();
  repaint();
  }

}
