Applet window not being painted

publicvoid paint(Graphics g){

map = mapb;

gfx = buffer.getGraphics();

for(i = 0;i < 11;i++){

for(n = 0;n < 11;n++){

switch (map[n][i]){

case 1: gfx.drawImage(grass,n*50,i*50,null);

break;

case 2: gfx.drawImage(water,n*50,i*50,null);

break;

case 3: gfx.drawImage(dirt,n*50,i*50,null);

break;

case 4: gfx.drawImage(rock,n*50,i*50,null);

break;

case 5: gfx.drawImage(grass,n*50,i*50,null);

gfx.drawImage(carl,n*50,i*50,null);

break;

case 6: gfx.drawImage(path,n*50,i*50,null);

break;

case 7: gfx.drawImage(floor,n*50,i*50,null);

break;

}

}

}

g.drawImage(buffer,0,0,null);

}

When that code runs, it the image buffer somehow doesnt make it onto the screen. I donno if this extra code will help but:

publicvoid start(){

new Thread(this).start();

player =new User("Mockers");

resize(550,550);

}

publicvoid run(){

Graphics g = this.getGraphics();

while(true){

paint(g);

try{

Thread.sleep(100);

}catch(InterruptedException e){

e.printStackTrace();

}

}

}

null

[3013 byte] By [Futurisdom_Developera] at [2007-10-2 21:07:03]
# 1
in paint, you have to draw the images with your Graphics that you gave in the parameter aka g and not gfx, but i might be wrong.
PlasmaLinka at 2007-7-13 23:52:38 > top of Java-index,Other Topics,Java Game Development...
# 2
> in paint, you have to draw the images with your> Graphics that you gave in the parameter aka g and not> gfx, but i might be wrong.even if you were wrong it would seem silly to declare a second gfx object...
sosleepya at 2007-7-13 23:52:38 > top of Java-index,Other Topics,Java Game Development...