Z-ordering window in java

Is there a way to control the z-ordering of a JDialog window in java?

I would like to be able to assign each window to a layer so that windows at lower levels can never go outside and hide windows at higher levels. Even when they have a focus. Like the Z-order function that exists for components, but for JDialog windows.

The solution should not work in all OSs. Linux-specific solution is acceptable.

+5
source share
2 answers

The only control I could find for the Z-order of the windows was that you can send them to the top of the order using the toFront () function, or you can set them as always from the top using setAlwaysOnTop (). This is a very simple z order, it doesn't seem that the Window class gives you the same fine grain order as the components inside the containers.

0
source

Since Java now supports transparent and shaped windows , you can fake this with an invisible window and make Windows components, or possibly JInternalFrames , just “real” .

0
source

All Articles