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

