ja klar code:

public void grenze()

{ int x = getX();

int y= getY();

int h =getWorld().getHeight();

int w =getWorld().getWidth();

if(x==0){

setLocation(w-1,y);

if(x==w-1){

setLocation(0,y);

if(y==0){

setLocation(x,h-1);

if(y==h-1){

setLocation(x,0);