I have a JSplitPane with a JTree on the left and a JTabbedPane on the
right. I want the JTabbedPane replaced, based on the actual type of the
object that is clcked.
That works OK but the following happens:
On the first time click on an object in the tree, the JTabbedPane
appears but only half filled. The second time I click (without changing
the object in the tree), the JTabbedPane appears fully filled.
Exactly the same code is executed:
if(e.getClickCount() == 1)
{
DefaultMutableTreeNode selectedObject =
(DefaultMutableTreeNode)selPath.getLastPathComponent();
if( selectedObject.getUserObject() instanceof RootNode)
{
RootTabbedPane tabbedPane = new RootTabbedPane();
splitPane.setRightComponent(tabedPane }
else if( selectedObject.getUserObject() instanceof IntermediateNode)
{
IntermediateTabbedPane tabbedPane = new IntermediateTabbedPane();
splitPane.setRightComponent(tabedPane }
}
Can anyone give me an idea on how to solve this problem?
TIA
Joost
Andrew Thompson - 25 Jan 2005 08:31 GMT
> Can anyone give me an idea on how to solve this problem?
- pack()/validate(), else..
- <http://www.physci.org/codes/sscce.jsp>
HTH

Signature
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane