ordering moving images in swing
I have an app, where I display few images in a frame. We can move images.
Images are in order they are loaded, so that if we drag one image over other than one which got loaded later, gets on the top.
But I want the one to be dragged to get on top, irrespective of when it was loaded. (i.e irrespective of its order).
-------
I think I did not write well enough to clearly express my concern.
I am using paintcomponent(). But problem is that my app allows to move/drag images over one other.
And I want the image which is dragged to be always on top. So, if there are two images (let us say A and B), then I want A to be on top if A is dragged over B and B to be on top(visible), if B is dragged over A. If both images are at different positions, both are visible.. but if they overlap each other ,then the one which is dragged over other should remain at top.
Hopefully I explained better this time.
Thanks!