Add application to JSplitPane

I want to create a menuapplication with a JSplitPane containing:

1) JTree on the left

2) JScrollPane with a JPanel (cardlayout) on the right

The intention is to open other javaapplications on the rightpanel depending the option choosen in the JTree...

When I click an option in JTree i'm able to show a JLable on the right.

But I am not able to show an javaapp (extends JFrame) on the right.

The javaapp is lauched but the menuapp receives following error:

java.lang.IllegalArgumentException: adding a window to a container

at java.awt.Container.addImpl(Container.java:652)

at java.awt.Container.add(Container.java:343)

at application.AppFrame.valueChanged(AppFrame.java:321)

at javax.swing.JTree.fireValueChanged(JTree.java:2424)

any suggestions?

[828 byte] By [pgoovaertsa] at [2007-11-27 1:26:54]
# 1
> But I am not able to show an javaapp (extends JFrame) on the right.Thats correct. JFrame, JWindow and JDialog are top level containers. You can't just add them to one another.Maybe you can use the getContentPane() method and add the content pane to your split pane.
camickra at 2007-7-12 0:22:09 > top of Java-index,Desktop,Core GUI APIs...