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
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.
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);
}
}.