Question

The jist of the problem is this: I have two JFrames, lets say a big JFrame Foo and smaller JFrame Baz. I have both open at the same time, is there a way to make Baz never be hidden "behind" Foo? Right now when Baz is "in front" and I click on Foo, Baz disappears behind Foo, which I don't want to happen.

Was it helpful?

Solution

Don't use two JFrames. You are trying to make the "bar" window behave like a dialog, and thus it in fact should be a dialog, a JDialog to be exact, and it should be set up so that its parent window is your "foo" JFrame.

OTHER TIPS

You could look at Java - control Z order of JPanels.

If using a JDialog is not an option (because you need a JFrame) then you could use this to manually define z-order rules.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top