Moving objects on the Z axis


#1

There is the methods bringObjectToFront(JGoObject obj) and sendObjectToBack(JGoObject obj) to move an object in front or in back of all other objects.
I also want to move an object in front of the next object or behind the previous object. I tried to use the insertObjectBefore and insertObjectAfter methods but I don’t success to use them. It doesn’t move anything and can give me StackOverflow errors.
Is it possible to do?


#2
Did you do something like: JGoLayer layer = obj.getLayer(); JGoListPosition p = layer.findObject(obj); layer.insertObjectAfter(layer.getNextObjectPosAtTop(p), obj); This code works for me.

#3

Thanks, it works for me too