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

public class starP extends JPanel
{  
Color c1=Color.blue;//for shape
Color c2=Color.white;//for background	 
public boolean fill=false;

public void setFill() {fill=true;}
public void setDraw() {fill=false;}
public void setColor(Color c) {c1=c;}
public void setColor(int red,int green, int blue) {c1=new Color(red,green,blue);}
public void setBColor(Color c) {c2=c;}
public void setBColor(int red,int green, int blue) {c2=new Color(red,green,blue);}
 
 
public void paintComponent(Graphics g)
{
super.paintComponent(g);
Graphics2D g2=(Graphics2D)g;
GeneralPath star=new GeneralPath();	 
int x[]={55,67,109,73,83,55,27,37,1,43};
int y[]={0,36,36,54,96,72,96,54,36,36};
star.moveTo(x[0],y[0]);
for(int i=1;i<x.length;i++)
   {star.lineTo(x[i],y[i]);}
star.closePath();
g2.setColor(c1);
this.setBackground(c2);
if(fill) g2.fill(star);
else g2.draw(star); 
  }
}
