Thanks god it's working I love you.
For moving the picture smoothly an fast I did something like that:
It moves fast but I see the picture before the loop and after and not in every iteration of the loop.Code:
if(arg0.getKeyCode() == KeyEvent.VK_LEFT)
this.posX -= 1;
Do you know why?
btw I'm doing it because moving pixel by pixel is very slow.