tags:

views:

160

answers:

2

I am in a situation where i create FrameB from my main frame FrameA. When the user is working on FrameB i would like it to be on top of FrameA even when user accidentally clicks on FrameA?

+1  A: 

You could consider making FrameB a JDialog instead of JFrame, and set it modal.

Joonas Pulakka
+2  A: 

Do you have to use a JFrame?

If you use a JDialog instead of a JFrame and assign FrameA as the owner of the dialog through the constructor it will always remain on top of the frame.

Otherwise you can use setAlwaysOnTop() from the window class, but this can be dependent on the operating system/window manager.

Aaron