Question

I want to have a JFrame that is always on top of another 'parent' frame but not always on top of everything

I have attempted to use:

  1. JInternalFrame -- doesn't work because I have to use JDesktopPane which is unnaceptable because the parent frame relies on a Border layout.
  2. JFrame with setAlwaysOnTop(true) -- doesn't work because I only want it to be on top of its parent frame

I'm imagining a method like setAlwaysOnTopOf(JFrame parent). Is there a way to do this?

Was it helpful?

Solution

I want to have a JFrame that is always on top of another 'parent' frame

Applications should only contain a single JFrame. If you need a child window then use a (modal?) JDialog and specify the frame as the parent.

OTHER TIPS

that depends on which container you are using... bind your jFrame to the container.. try with add method..

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