views:

245

answers:

2

Is there a way to manage the window z-ordering of JDialog windows within java?

I would like to able to assign each window to a layer such that windows on lower layers can never go above and obscure windows on higher layers. Even when they have focus. Similar to the Z-order capability that exists for components but for JDialog windows.

The solution does not need to work across all OSes. A linux specific solution is acceptable.

A: 

The only management I have been able to find for the Z order of windows has been that you can send them to the top of the order with toFront() or that you can set them as always on top with setAlwaysOnTop(). This is very basic z ordering, it doesn't seem that the Window class gives you as much fine grain ordering as Components inside Containers do.

Brandon Bodnár
A: 

Since Java now supports transparent and shaped windows, you might be able to fake this using an invisible window, and making the "real" windows just components, or perhaps JInternalFrames.

David Moles
Thanks. Unfortunately I'm forced to use heavy weight components (jogl canvas) in some of the windows so I cannot using JInternalFrames.
Aaron