Window.getChildWindows() - Sort Order?

Hello Group,

If I call Window.getChildWindows(), how is the returned list sorted?
Oldest windows first, newest last?

Is there a way to sort the returned windows by their z-indeces?
Top most windows at last, windows in the back first?

Any ideas?

Thanks for you help!

As far as i can see from the code the windows are kept in a LinkedHashSet so you actually get an ordered set following the ordering of insertion. The last windows added should have a higher z-index. So i assume you get an ordering of windows where the first windows have the smallest z-index and the last windows are the ones added later with higher z-index.

However i’m not sure about the z-indeces if you don’t remove a window, but only hide it and then add another one. You should run a couple of tests. So if it is critical to you, i would have my own windowmanager with a collection/list of the important windows added.

Thanks for the reply.

I already did some testing and it is true, windows are returned sorted by their time of insertion.
Unfortunately this does not have to match with their z-index. In my application for example I bring windows to the front as soon as they are clicked.
Just one way of mixing the list.

But having the list sorted by their insertion time is a good way to go, at least for me! :wink:

An own windowmanager would be a good idea and not too complicated, too.

Thanks again!