7

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.

Aaron
  • 5,931
  • 4
  • 27
  • 31
  • this appears to be a duplicate of http://stackoverflow.com/questions/767605/is-there-a-swing-hack-to-query-or-set-z-order-of-a-window – akf Jun 14 '09 at 23:23
  • Your right, it is a dupe. I searched the z-order AND zorder tags before positing and still missed that one. Am I now supposed to delete this or does a moderator close/dupe it? – Aaron Jun 15 '09 at 20:35
  • It's not quite a duplicate -- the actual use case is pretty different. – David Moles Aug 13 '09 at 09:09

2 Answers2

1

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 Bodnar
  • 8,202
  • 2
  • 36
  • 42
0

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
  • 48,006
  • 27
  • 136
  • 235
  • Thanks. Unfortunately I'm forced to use heavy weight components (jogl canvas) in some of the windows so I cannot using JInternalFrames. – Aaron Aug 13 '09 at 18:39