Read child nodes in Jtree

Need some help in reading the child nodes in a jTree after a parent node has been selected.
I've created a Jtree using DefaultMutableTreeNode. When I select a node, I'm able to read the contents of that node but can't figure out how to read all the children beneath it.
I'm using this code to read the current selected path:
TreePath tp1 = jTreeTOC.getSelectionPath();
Object bal_Grp[] = tp1.getPath();
int iNodeCnt = bal_Grp.length;
if (iNodeCnt > 1) {
String sTOCNode = bal_Grp[iNodeCnt-1].toString();
So my sTOCNode is the selected one, now how do I get the children.
Any help is appreciated.
Thanks

Read the tutorial:
http://java.sun.com/docs/books/tutorial/uiswing/components/tree.html#select
If you use getLastSelectedPathComponent you get back DefaultMutableTreeNode object of the selected node.
You can use it to get the children of the selected node.

Similar Messages

  • Lining up root node and child nodes in JTree

    I have a JTree that has a root node and n child nodes. There are no sub-levels - it is structured just like AOL instant messenger. What I want to do is have the child node icons line up directly under the root nodes text. For example (if you can read this), where "-" denotes the icon:
    - root
    - child
    - child
    Currently it is something like this:
    - root
    - child
    - child
    I have been messing with the setLeftChildIndent( int ) and setRightChildIndent( int ), but they are not doing much...they seem to not want to only move the leaf nodes but all of the nodes, so its not doing exactly what I want.
    Any ideas? In the meantime I'll be looking more into how exactly those indent mutators work.
    Thanks!

    What you want is to do a setRootVisible(false) on the JTree.
    All your child nodes are then your "root level" folders.
    tree.setRootVisible(true):
    +root
    +--child1
    +--child2
    +--child3
    +----child3a
    +----child3btree.setRootVisible(false):
    +child1
    +child2
    +child3
    +--child3a
    +--child3b

  • How can I remove child node from JTree???

    Hi,
    I would like to remove all the child node of my jtree. For instance I would like to remove the c, d, and e nodes. It's possible to remove all the child node or to remove by her name ("c", "d", and "e"). If yes what is the method that it permit to do.
    A-----
    |
    b-------c
    |
    |--------d
    |
    ---------e
    I use the model : DefaultMutableTreeNode
    Thanks

    There are a couple of ways it can be done. If your tree uses DefaultTreeModel as its TreeModel, you can use removeNodeFromParent(). This will remove the node from its parent and effectively remove its children, too. All nodes removed will be garbage-collected if there are no other references to them.
    If your tree model is not the default tree model, but still uses MutableTreeNode, you can use either remove() or removeFromParent() on the node itself, depending on whether you want to remove the node itself or one of its children.
    On the other hand, your tree may use a model that simply "mirrors" another data structure, in which case you would have to remove the node from the other data structure and have it reflected in the model.

  • How to search a child node in JTree

    Hi I am new to swings..
    My requirement is I have a Jsplit pane.
    I have search button with a text box in one and Jree in another pane.
    When I enter a string and hit Search button...It need to search the tree and expand that node highlight it.
    can anyone help in getting this done.

    public void actionPerformed(ActionEvent e)
      DefaultTreeModel m_model = new DefaultTreeModel(entityRoot);
      DefaultMutableTreeNode node = searchNode(m_searchText.getText());
      JTree m_tree = new JTree(m_model);
      TreePath root = m_tree.getPathForRow(0);
      searchTree(m_tree, root, m_searchText.getText());
    private void searchTree(JTree tree, TreePath path, String q)
    TreeNode node = (TreeNode)path.getLastPathComponent();
    if(node==null) return;
    if(node.toString().startsWith(q))
       tree.setScrollsOnExpand(true);
       tree.setSelectionPath(path);
    if(!node.isLeaf() && node.getChildCount()>=0)
       Enumeration e = node.children();
       while(e.hasMoreElements())
       searchTree(tree, path.pathByAddingChild(e.nextElement()), q);
    }Edited by: EJP on 27/06/2011 09:53: added {noformat}{noformat} tags. Please use them.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Moving child node's parent in JTree

    hi guys.
    What i have is a Jtree dynamically generated, im trying to re-arrange the nodes inside.
    each nodes and their parents have their own values and been built with DefaultMutableTreeNode.
    So im thinking, to do so i first need to analyse which child node i want to move, then remove it from its current parent, then set the new parent to this node.
    I been thinking of using the values and compare them to do the parent-node matching, however, i have been looking at the APIs without luck, for methods to possible retrieve the values of the childs/parents.
    Or perhaps there is a simpler way,
    Does anybody have a clue where i could find some answers to this problem?
    Cheers, Eric.

    aiwick wrote:
    hi guys.
    What i have is a Jtree dynamically generated, im trying to re-arrange the nodes inside.
    each nodes and their parents have their own values and been built with DefaultMutableTreeNode.
    So im thinking, to do so i first need to analyse which child node i want to move, then remove it from its current parent, then set the new parent to this node.
    I been thinking of using the values and compare them to do the parent-node matching, however, i have been looking at the APIs without luck, for methods to possible retrieve the values of the childs/parents.
    Or perhaps there is a simpler way,
    Does anybody have a clue where i could find some answers to this problem?
    Cheers, Eric.Not sure what the problem is exactly. DefaultMutableTreeNode has methods for retrieving it's parent and child nodes: which is all you need to move nodes in your tree.

  • Inconsistent results for adding child node in a JTree

    I have a JTree where I add child nodes when a user clicks on the node or handle. When the user clicks on the node, through implementing TreeSelectionListener interface, I add a node, the tree expands, and I see the newly added node. However, when the user clicks on the handle, through implementing the TreeExpansionListener, the tree does not expand and I do not see the newly added node. The problem is repeatable by compiling the code below.
    Why is there this difference? Aren't all the methods implemented through the TreeSelectionListener and TreeExpansionListener in the SWT thread?
    public class TestFrame extends JFrame implements TreeSelectionListener, TreeExpansionListener {
         public TestFrame() {
              String[] alphabets = {
                        "a", "b", "c", "d", "e", "f", "g",
                        "h", "i", "j", "k", "l", "m", "n",
                        "o", "p", "q", "r", "s", "t", "u",
                        "v", "w", "x", "y", "z"
              DefaultMutableTreeNode top = new DefaultMutableTreeNode("CEDICT");
              for(int i=0; i < alphabets.length; i++) {
                   DefaultMutableTreeNode node =
                        new DefaultMutableTreeNode(alphabets) {
                        public boolean isLeaf() { return false; }
                   top.add(node);
              JTree tree = new JTree(top);
              tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
              tree.addTreeSelectionListener(this);
              tree.addTreeExpansionListener(this);
              tree.setShowsRootHandles(true);
              JScrollPane treePane = new JScrollPane(tree);
              treePane.setHorizontalScrollBarPolicy(
                        JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
              treePane.setVerticalScrollBarPolicy(
                        JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
              treePane.setSize(new Dimension(200,400));
              treePane.setPreferredSize(new Dimension(200,400));
              getContentPane().setLayout(new BorderLayout());
              getContentPane().add(treePane, BorderLayout.CENTER);
              Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
              int inset = 50;
    setBounds(inset, inset,
    screenSize.width - inset*2,
    screenSize.height - inset*2);
              setLocationRelativeTo(null);
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              pack();
              show();
         public static void main(String[] args) {
              SwingUtilities.invokeLater(new Runnable() {
                   public void run() {
                        JFrame.setDefaultLookAndFeelDecorated(true);
                        TestFrame frame = new TestFrame();
         public void valueChanged(TreeSelectionEvent e) {
              JTree tree = (JTree)e.getSource();
              DefaultMutableTreeNode node =
                   (DefaultMutableTreeNode) tree.getLastSelectedPathComponent();
              System.out.println(node);
              Date date = new Date();
              node.add(new DefaultMutableTreeNode(date.toString()));
         public void treeCollapsed(TreeExpansionEvent event) {
              JTree tree = (JTree)event.getSource();
              TreePath path = event.getPath();
              DefaultMutableTreeNode node =
                   (DefaultMutableTreeNode) path.getLastPathComponent();
              System.out.println(node);
              Date date = new Date();
              node.add(new DefaultMutableTreeNode(date.toString()));
              tree.invalidate(); //does not help to show newly added child
         public void treeExpanded(TreeExpansionEvent event) {
              JTree tree = (JTree)event.getSource();
              TreePath path = event.getPath();
              DefaultMutableTreeNode node =
                   (DefaultMutableTreeNode) path.getLastPathComponent();
              System.out.println(node);
              Date date = new Date();
              node.add(new DefaultMutableTreeNode(date.toString()));
              tree.invalidate(); //does not help to show newly added child

    I couldn't figure out why inserting a node in the valueChanged(...) method works. In all three methods no listeners are notified about the change, so you would think all three would fail.
    For a JTree using the DefaultTreeModel the nodesWereInserted(...) method needs to be called. For example, if I change your last three methods to this
    public void valueChanged(TreeSelectionEvent e) {
       insertNode((JTree) e.getSource(),
                  (MutableTreeNode) e.getPath().getLastPathComponent());
    public void treeCollapsed(TreeExpansionEvent event) {
       insertNode((JTree) event.getSource(),
                  (MutableTreeNode) event.getPath().getLastPathComponent());
    public void treeExpanded(final TreeExpansionEvent event) {
       insertNode((JTree) event.getSource(),
                  (MutableTreeNode) event.getPath().getLastPathComponent());
    public void insertNode(JTree tree, MutableTreeNode parent) {
        Date date = new Date();
        MutableTreeNode child = new DefaultMutableTreeNode(date.toString());
        int index = parent.getChildCount();
        parent.insert(child,index);
        ((DefaultTreeModel) tree.getModel())
                .nodesWereInserted(parent,new int[]{index});
    }then it works as you desire. You can (and should) of course use the DefaultTreeModel's own insert method.
    DefaultTreeModel#insertNodeInto(MutableTreeNode,MutableTreeNode, int)

  • How to open a dialog box while double cliking the JTree child node.

    hi
    I am new to Swing technology.I want to open a dialog box while double clicking the child node of a tree.Could anyone please send me some examples.

    mouse listener on the tree, see if the click count is 2 and what node it clicked, open the dialog. MouseEvent can give you the click count and x/y coordinate, JTree can tell you what node is at that coordinate.

  • How to open to a set child node using the swing jtree bound to adf views

    Hi All, I have an oracle adf jclient application that implements a jtree based on view objects derived from my database tables. Everything is working except that when a child table is updated and I re executequery() on my viewobject that is bound to the jtree, the tree collapses. Is there any way to programatically navigate the tree to open and select the new child node/object?

    Hi,
    didn't try it yet, but http://javaalmanac.com/egs/javax.swing.tree/FindNode.html
    may be helpful
    Frank

  • Read Xml Child node from XML Blob

    Hi Gurus,
    Greetings
    I am working in oracle 10g /Solaris platform.
    I have table with columns namely id varcha2,pmt blob.
    PMT stores xml file.
    <Products xmlns:source="http://apache.org/cocoon/source/1.0" DocStatus="approved" DocTimeStamp="2013-04-18T06:52:14" DocType="PMT" DocVersion="xUCDM_product_external_1_3.xsd">
    <Product Country="DE" IsAccessory="false" IsLocalized="true" IsMaster="false" Locale="de_DE" lastModified="2013-04-18T00:08:11" masterLastModified="2013-02-25T14:46:40">
    <Assets>
      <Asset code="46PFL8008S_12" description="User manual" extension="pdf" extent="3359201" lastModified="2013-04-18" locale="de_DE" number="001" type="DFU">http://download.p4c.abc.com/files/4/46pfl8008s_12/46pfl8008s_12_dfu_deu.pdf</Asset>
      <Asset code="46PFL8008S_12" description="Leaflet" extension="pdf" extent="970750" lastModified="2013-04-18" locale="de_DE" number="001" type="PSS">http://download.p4c.abc.com/files/4/46pfl8008s_12/46pfl8008s_12_pss_deu.pdf</Asset>
      <Asset code="46PFL8008S_12" description="Quick start guide" extension="pdf" extent="911832" lastModified="2013-04-18" locale="de_DE" number="001" type="QSG">http://download.p4c.abc.com/files/4/46pfl8008s_12/46pfl8008s_12_qsg_deu.zip</Asset>
      <Asset code="46PFL8008S_12" description="Front product photograph - highres 2196x1795" extension="jpg" extent="1989253" lastModified="2013-04-18" locale="global" number="001" type="_FP">http://images.abc.com/is/image/abcConsumer/46PFL8008S_12-_FP-global-001</Asset>
      <Asset code="46PFL8008S_12" description="Alternative product photograph 1 - highres 2196x1795" extension="jpg" extent="603474" lastModified="2013-04-18" locale="global" number="001" type="A1P">http://images.abc.com/is/image/abcConsumer/46PFL8008S_12-A1P-global-001</Asset>
      <Asset code="46PFL8008S_12" description="Alternative product photograph 2 - highres 2196x1795" extension="jpg" extent="407701" lastModified="2013-04-18" locale="global" number="001" type="A2P">http://images.abc.com/is/image/abcConsumer/46PFL8008S_12-A2P-global-001</Asset>
      <Asset code="46PFL8008S_12" description="Alternative product photograph 3 - highres 2196x1795" extension="jpg" extent="174261" lastModified="2013-04-18" locale="global" number="001" type="A3P">http://images.abc.com/is/image/abcConsumer/46PFL8008S_12-A3P-global-001</Asset>
      <Asset code="46PFL8008S_12" description="Alternative product photograph 4 - highres 2196x1795" extension="jpg" extent="109712" lastModified="2013-04-18" locale="global" number="001" type="A4P">http://images.abc.com/is/image/abcConsumer/46PFL8008S_12-A4P-global-001</Asset>
       </Assets>
    </Product>
      </Products>');
      I want the extract the ids from the table where pmt contains the child node (asset) contains .zip
    for example http://download.p4c.abc.com/files/4/46pfl8008s_12/46pfl8008s_12_qsg_deu.zip
    Then, I tried like this...
      select r.* from
       (SELECT xmltype(pmt) object_value
                     FROM PRODUCT_TR_PMT
                     XMLTABLE
                                     'for $Product  in $TEST/Products/Product/Assets/Asset
                                         return <RESULT>
                                                   $Product                     
                                                </RESULT>'
                                     passing OBJECT_VALUE as "TEST"   
                                     columns Asset path 'Asset' 
                                 ) r;
    ORA-02263: need to specify the datatype for this column
      Could you kindly help.
    Thanks
    Raj

    Blob storage we (db folks) dont have any control its from application standard design.
    If necessary, i can create function blob to clob.
    Kindly help me in extracting child node which contains zip.
       select r.* from
       (SELECT xmltype(pmt) object_value
                     FROM PRODUCT_TR_PMT
                     XMLTABLE
                                     'for $Product  in $TEST/Products/Product/Assets/Asset
                                         return <RESULT>
                                                   $Product                     
                                                </RESULT>'
                                     passing OBJECT_VALUE as "TEST"   
                                     columns Asset varchar2(255) path 'Asset' 
                                 ) r;
    ORA-06553: PLS-306: wrong number or types of arguments in call to 'XMLTYPE'Thanks
    Raj

  • How can provide parent-child nodes relation ships?

    how can provide parent-child nodes relation ships?

    I was under the impression that scenegraph is like a JTree. But in JavaFX only leaf node rendering in scenegraph. This situation was confusing my mind. In JavaFX CustomNode must be extending and return a group for custom leaf. If we want to a create parent-child node hierarchy we are create CustomNode that return a group and this group contain an another group,etc. So there is maybe only a way. If you learning to JavaFX first time.This way don't look familiar.

  • Problem inserting new node into JTree with depthFirstEnumeration()

    Hello,
    I'm currently trying to use depthFirstEnumeration() to add and delete nodes for a simple JTree. I've written a method to handle this, but it keeps coming back with an exception saying that 'new child is an ancestor'.
    All I'm trying to do is add and delete nodes from a JTree using add and remove buttons within a swing program. When a user adds the new node the JTree needs to be updated with new labels in sequential order dependent upon a depthFirst traversal of the JTree.
    My current code for the add button is as follows,
    public void actionPerformed(ActionEvent event) 
            DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode)tree.getLastSelectedPathComponent();
            Enumeration e = rootNode.depthFirstEnumeration();
            if(event.getSource().equals(addButton))
                if (selectedNode != null)
                    while (e.hasMoreElements()) {
                    // add the new node as a child of a selected node at the end
                    DefaultMutableTreeNode newNode = (DefaultMutableTreeNode)e.nextElement();
                     // treeModel.insertNodeInto(newNode, selectedNode, selectedNode.getChildCount());
                    //System.out.print(newNode.getUserObject() + "" + newNodeSuffix++);
                    String label = "Node"+i;
                    treeModel.insertNodeInto(newNode, selectedNode, selectedNode.getChildCount());
                    i++;
                      //make the node visible by scrolling to it
                    TreeNode[] totalNodes = treeModel.getPathToRoot(newNode);
                    TreePath path = new TreePath(totalNodes);
                    tree.scrollPathToVisible(path);
                    //System.out.println();
            else if(event.getSource().equals(deleteButton))
                //remove the selected node, except the parent node
                removeSelectedNode();           
        } As you can see in the above code, I've tested the incrementing of the new nodes in a System.out.print() statement and they appear to be incrementing correctly. I just can't see how to correctly output the labels for the nodes.
    Any help and advice always appreciated.

    This is about the 5th posting on the same question. Here is the link to the last posting so you can see what has already been suggested so you don't waste your time making the same suggestion.
    http://forum.java.sun.com/thread.jspa?threadID=704980
    The OP doesn't seem to understand that nodes don't just rename themselves and that renderers will only display the text of the current node. If you want the text displayed to changed, then you need to change the text associated with each node, which means iterating through the entire tree to update each node with new text. Then again, maybe I don't understand the question, but the OP keeps posting the same question without any additional information.

  • Making a node in JTree non expandable

    How do I make a node in a JTree non expandable. The nodes in the tree are DefaultMutableTreeNode. I have a tree with root R. It has children ch1, ch2, ch3. Nodes ch1 etc also have X number of children. What I want is if I click (either double click on the node or single clicking on the '+') on either of the child nodes ch1, ch2 and ch3 to disable expansion i.e. stop the tree collapsing beyond those nodes. I have tried tree.setExpandsSelectedPaths(false) and others but it still doesnt work. Any help much appreciated. Thanx.

    Thanx Jeanette, that is exactly!! what I'm looking for. Much appreciated.

  • JCheckBox as nodes in JTree having problems with custom renderer and editor

    Ok, let me give some background. I have an XML document that I am parsing and reading in as a JTree. Works fine.
    Next, I have overwritten the DefaultTreeCellEditor to return a JCheckBox and in this implementation of the getTreeCellEditorComponent(), I actually tell the node that he is selected. Works great.
    Next, I have overwritten the DefaultTreeCellRenderer to return a JCheckBox and in the implementation of the getTreeCellEditorComponenet, I actually check to see if the Node is selected in the tree based upon the isSelected state of the actual Tree Node set in the tree cell editor, and if so, I set the JCheckBox to selected(true).Works Great.
    Now, here is the issue. If a node in the tree is selected that contains children, then I want all of the children of that node to also be selected. However, when I select a node with children only the selected node is changed, and then a few moments later, the system repaints the entire tree and ALL nodes int the tree are set to a selected state. Strange? Yes. Any ideas?? WONDERFUL!! :)
    Here is the TreeCellEditor code:
    public Component getTreeCellEditorComponent(JTree tree,
    Object value,
    boolean isSelected,
    boolean expanded,
    boolean leaf,
    int row)
    elementCheckBox_ = new JCheckBox();
    Component result = null;
    System.out.println("isSelected? Editor = " + isSelected);
    TreePath newPath = tree.getPathForRow(row);
    System.out.println("value = " + value.getClass().toString());
    if(value instanceof IMarketTreeNodeElement)
    if(isSelected)
    if(((IMarketTreeNodeElement)value).isSelected())
    ((IMarketTreeNodeElement)value).setSelected(false);
    else
    ((IMarketTreeNodeElement)value).setSelected(true);
    elementCheckBox_.setSelected(isSelected);
    return elementCheckBox_;
    Here is the TreeCellRenderer code:
    public Component getTreeCellRendererComponent(JTree tree,
    Object value,
    boolean selected,
    boolean expanded,
    boolean leaf,
    int row,
    boolean hasFocus)
    Color colSelBorderCol = UIManager.getColor
    ("Tree.selectionBorderColor");
    selBorder_ = BorderFactory.createLineBorder(colSelBorderCol, 1);
    normBorder_ = BorderFactory.createEmptyBorder(1,1,1,1);
    elementCheckBox_.setText(value.toString());
    if(selected)
    elementCheckBox_.setSelected(selected);
    elementCheckBox_.setForeground(Color.YELLOW);
    elementCheckBox_.setBackground(Color.RED);
    else
    elementCheckBox_.setForeground(tree.getForeground());
    elementCheckBox_.setBackground(tree.getBackground());
    if (hasFocus)
    elementCheckBox_.setBorder(selBorder_);
    else
    elementCheckBox_.setBorder(normBorder_);
    return elementCheckBox_;
    Here is the Node Code setting all child nodes to selected:
    public void setSelected(boolean selected)
    isSelected_ = selected;
    if(isSelected_)
    if((this.getTagName() == "MARKET") ||
    (this.getTagName() == "TIER") &&
    (this.getChildCount() != 0))
    selectChildren(true);
    else
    if((this.getTagName() == "MARKET") ||
    (this.getTagName() == "TIER") &&
    (this.getChildCount() != 0))
    selectChildren(false);
    public boolean isSelected()
    return isSelected_;
    public void selectChildren(boolean selected)
    int children = getChildCount();
    for(int i = 0; i < children; i++)
    IMarketTreeNodeElement elem = (IMarketTreeNodeElement)
    this.getChildNodes().item(i);
    isSelected_ = selected;
    Thanks for any help! :-)

    I tried to run your sample code and it won't compile. The header files:
    #include
    #include
    #include
    #include
    #include
    do not exist on my install of MeasurementStudio. I am a bit suspicous that I don't have the latest and greatest (loading the dialong resouce gave version warnings). Here is one of my header file headers:
    //==============================================================================
    // Title : NiAxes3d.h
    // Copyright : National Instruments 1999. All Rights Reserved.
    // Purpose : Defines the CNiAxes3D class.
    //==============================================================================
    I
    looked on your updates site and don't really see an update that applies to ComponentWorks or MeasurementStudio. My version per the MAX program for 3DControls is 3.5.549.
    Do I need a newer version? What do I have to do to get the updated version? What does it cost?
    Chuck

  • Color of parent/child lines in JTree

    Hi,
    i am using a JTree with a custom CellRenderer. This works quite ok but i also want to change the color from the fine lines between parent and child nodes. Right now they are in the typical "SUN" color but cause of my background i need them to be black.
    node
    |
    |--- child1
    |
    |--- child2
    I mean the lines which i just drawn in ASCII Art, really dont know the english word for it.
    Thx

    i am not weird, i am replying to myself, because perhaps someone might need it afterwards.
    you can change the color of the lines between nodes in JTree, therefore you must go the UIManager way:
    UIManager.put("Tree.hash", new ColorUIResource(Color.lightGray));
    This changes all Trees in your application. You can do similar changes on instance basis:
    myJTree.putClientProperty("JTree.lineStyle", "Angled");
    but i havnt figured out why i cant do this for the "Tree.hash" key on instance basis but anyway. Its ok now...

  • Displaying child nodes on demand

    Hi there,
    I'm working on a client/server project where the client side app has a JTree. I am trying to set up a TreeModel so that it retrieves from the server app the names of the child nodes of a given parent node when the treeWillExpand(TreeExpansionEvent tee) od gets triggered. So far I've accomplished this. In my TreeModel class I have a od called:
    ReceiveChildrenFromServer(DefaultTreeNode parent, String ParentsWholePath, DataInputStream input)
    This od does what it is supposed to, however, once it has populated the parent node, I expected the JTree to display the nodes. This is not happening. Can someone please explain how I get the JTree to then display the child nodes.
    Thanks,
    Alan

    What all methods have u overridden in the Treemodel & is it extending the DefaultTreeModel?

Maybe you are looking for