When the images of some of my objects overlap only one of them is shown because it is more in the foreground. How can I swap them so the other object is actually in the foreground when it tries to overlap another object?
If they are of different 'type's, and you always want one 'type' above another, you can use the setPaintOrder method in the World class (that is the easy one to arrange).
If they are of different 'type's, but do not always want one 'type' above the other, or if they are of the same type, you can arrange them as needed on the fly. You accomplish this by taking the object you want to be above the other, and after saving its getX() and getY() in variables, remove it from the world and re-insert it at the same location by using the co-ordinates you had saved.