Preventing loss of JInternalFrame behind JToolBar?

Is there a way to prevent the loss of ability to move a JInternalFrame when the frame slips behind a JToolBar?

Ideally i would like to prevent all JInternalFrames from being able to slip behind a JDesktopPane and its set JToolBar.

thanks for any and all help,

Steven Eliuk

[298 byte] By [m3the01a] at [2007-11-27 10:16:20]
# 1

Use a panel with a BorderLayout. Add the toolbar to the North and the desktoppane to the Center.

camickra at 2007-7-28 15:45:00 > top of Java-index,Desktop,Core GUI APIs...
# 2

But this is a desktop?

m3the01a at 2007-7-28 15:45:00 > top of Java-index,Desktop,Core GUI APIs...
# 3

Yeah i used setJMenuBar to set the menubar, has no option for setting layout. I really couldnt believe it was happening, i would assume with a menubar added it would limit the internalframes from going behind the menu bar.

thanks again for the help

m3the01a at 2007-7-28 15:45:00 > top of Java-index,Desktop,Core GUI APIs...
# 4

I've run into a related problem with JInternalFrames being 'lost' because the user resized the main window smaller, and the JIF was no longer visible.

I added a ComponentListener to the JDesktopPane that reacted to resizing events (componentResized( ComponentEvent e )). In that method, I simply get all of the JIFs from the JDesktopPane, and check each one to see if its location is visible. If not, I reposition it to the edge of the JDesktopPane.

If your case is caused by resizing of the desktop, then the above will work. If the user is moving the JIF underneath the JToolbar/JMenuBar, then you might be able to add ComponentListeners to each JIF, and check its location everytime componentMoved( ComponentEvent e ) is called.

ddg412a at 2007-7-28 15:45:00 > top of Java-index,Desktop,Core GUI APIs...
# 5

Yeah i guess component listener is the only way,

Good call, forgot that one.

Steven

m3the01a at 2007-7-28 15:45:00 > top of Java-index,Desktop,Core GUI APIs...