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.
Asked
Active
Viewed 147 times
1
-
2See also [The Use of Multiple JFrames, Good/Bad Practice?](http://stackoverflow.com/a/9554657/418556) – Andrew Thompson Mar 14 '14 at 09:17
2 Answers
5
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.

Hovercraft Full Of Eels
- 283,665
- 25
- 256
- 373
2
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.