JFrame that contains JTabbedPane+ InternalFrames

Hi,On a JFrame I want to add a JTabbedPane + JInternalFrames.Tried a JLayeredPane but that didn't help out.Any1 has a idea how to realize this ?
[173 byte] By [BennoTa] at [2007-11-26 12:24:35]
# 1
JInternalFrames live in JDesktops.So it's just a case of how you want to lay out your JTabbedPane in relation to your JDesktop.Which we can only guess at.
itchyscratchya at 2007-7-7 15:26:04 > top of Java-index,Desktop,Core GUI APIs...
# 2

The internal frame must be drawed over the JTabbedPane.

Made an JLayeredPane desktop.

desktop = new JDesktopPane();

desktop.add(tabbedPane,JLayeredPane.DEFAULT_LAYER);

this.setContentPane(desktop);

But then then frame background is white and dont see the tabs

BennoTa at 2007-7-7 15:26:04 > top of Java-index,Desktop,Core GUI APIs...
# 3

Er, yes, don't go adding JTabbedPanes to JDesktops.

Do you mean you want one of the tabs to contain a JDesktop? If so just add the JDesktop as a tab.

Or do you want the whole desktop floating over a JTabbedPane? That's a really unorthodox way of going about things and I'd only do it if you've really thought things through properly - but if you need to do it then just you should be able to just use a JLayeredPane and add the JDesktop and JTabbedPane on different layers. Obviously you'll need to setOpaque(false) on the JDesktop otherwise you won't see through it.

You can't just add with a JLayeredPane constraint to any old component - it only makes sense in the context of JLayeredPane and its layout.

itchyscratchya at 2007-7-7 15:26:04 > top of Java-index,Desktop,Core GUI APIs...
# 4

The JDesktop containing the internal frame must be dragable over the JTabbedPane.

This is wot I tried also not working :(

public class TestFrame extends JFrame

{

private JTabbedPane tabbedPane;

private JDesktopPane desktopPane;

private JLayeredPane layeredPane;

public TestFrame()

{

InternalFrame test = new InternalFrame();

desktop = new JDesktopPane();

desktop.add(test);

desktop.setOpaque(true);

layeredPane = new JLayeredPane();

layeredPane .add(tabbedPane,JLayeredPane.DEFAULT_LAYER):

layeredPane .add(desktop,JLayeredPane.POPUP_LAYER):

this.getContentPane().add(layeredPane);

}

}.

BennoTa at 2007-7-7 15:26:04 > top of Java-index,Desktop,Core GUI APIs...