문제

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.

도움이 되었습니까?

해결책

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.

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top