create event by clicking at the jlabel
<p>I want to create event when clicking on <code>JLabel</code> when the value of playertyp is 1
how can i do that?
this is the class</p>

<pre><code>public class Draw_Board implements MouseListener,ActionListener
{

    private Point matloc;
    private ImageIcon partpic;
    private JLabel partstick;

    private boolean playerexis;
    private int playertyp=0;
    private boolean partexis;
    private boolean compute;
    private Part[][] map;



    public Draw_Board()
    {

        int x = 52;
        int y =49;

        map=new Part[9][12];
        for(int i=0;i&lt;9;i++)
        {
            for(int j=0;j&lt;12;j++)
            {
                matloc=new Point();
                if(i==j &amp;&amp; i==0)
                    {
                    partpic = new ImageIcon(getClass().getResource( "images/bird.png" ));
                    playertyp=1;//the bird equal to player 1

                    }
                else{
                    partpic = new ImageIcon(getClass().getResource( "images/stone.png" ));
                    playertyp=2;
                }

                partstick = new JLabel("",partpic,JLabel.CENTER);
                partstick.addMouseListener(this);

                matloc.setX(x);
                matloc.setY(y);
                x+=61;
                if(j==11)
                {
                    x=52;
                    y+=57;
                }




                partstick.setLocation(matloc.getX(),matloc.getY());
                partstick.setSize(60,60);

                map[i][j]=new Part(matloc,  partpic,  partstick,
                         playerexis, playertyp, partexis,   compute);

            //  if(i==0 &amp;&amp; j==0)System.out.println(partstick.getX()+" "+partstick.getY());


            }
        }   

    }




    public void draw(Panelmenu p)
    {


        for (int i = 0; i &lt; 9; i++) 
        {
            for (int j = 0; j &lt; 12; j++) 
            {
                map[i][j].draw(p);

            }
        }

    }








    public Point getMatloc() {
        return matloc;
    }




    public void setMatloc(Point matloc) {
        this.matloc = matloc;
    }




    public ImageIcon getPartpic() {
        return partpic;
    }




    public void setPartpic(ImageIcon partpic) {
        this.partpic = partpic;
    }




    public JLabel getPartstick() {
        return partstick;
    }




    public void setPartstick(JLabel partstick) {
        this.partstick = partstick;
    }




    public boolean isPlayerexis() {
        return playerexis;
    }




    public void setPlayerexis(boolean playerexis) {
        this.playerexis = playerexis;
    }




    public int getPlayertyp() {
        return playertyp;
    }




    public void setPlayertyp(int playertyp) {
        this.playertyp = playertyp;
    }




    public boolean isPartexis() {
        return partexis;
    }




    public void setPartexis(boolean partexis) {
        this.partexis = partexis;
    }




    public boolean isCompute() {
        return compute;
    }




    public void setCompute(boolean compute) {
        this.compute = compute;
    }




    public Part[][] getMap() {
        return map;
    }




    public void setMap(Part[][] map) {
        this.map = map;
    }






    @Override
    public void actionPerformed(ActionEvent e)
    {


    }

    @Override
    public void mouseClicked(MouseEvent e) {




    }

    @Override
    public void mousePressed(MouseEvent e) {
        // TODO Auto-generated method stub

    }

    @Override
    public void mouseReleased(MouseEvent e) {
        // TODO Auto-generated method stub

    }

    @Override
    public void mouseEntered(MouseEvent e) {
        // TODO Auto-generated method stub

    }
    @Override
    public void mouseExited(MouseEvent e) {
        // TODO Auto-generated method stub

    }

}
</code></pre>
