img=Toolkit.getDefaultToolkit().getImage("bb.png");
I am trying to draw the image on my JPanel but can't...
public void paintComponent(Graphics g)
{
super.paintComponent(g);
int w=getWidth();
int h=getHeight();
int divx=w/8;
int divy=h/8;
g.setColor(Color.RED);
for(int i=0;i<8;i=i+2)
for(int j=0;j<8;j=j+2)
{
g.fillRect(j*divx,i*divy,divx,divy);
g.fillRect((1+j)*divx,(1+i)*divy,divx,divy);
}
g.drawImage(img,10,10,50,50,this);
}
Please help me..

New Topic/Question
Reply



MultiQuote








|