JTree without expand/collapse icons

I want to be able to hide or change the expand/collapse icon of a specific node, not the entire Jtree.
Is there any way to do that?
Tahnx

I want to be able to hide or change the expand/collapse icon of a specific node, not the entire Jtree.
Is there any way to do that?
Tahnx

Similar Messages

  • How do I remove the "TOC" btn in the playbar WITHOUT removing the TOC "Expand/Collapse" icon?

    I am working in CP7 on a project with a Table of Contents that is set to 'Overlay'. The client has requested that I remove the "TOC" button in the playbar, without removing the TOC "Expand/Collapse" icon, so that the user can still hide/reveal the TOC when necessary. The only control I can find is the "Show TOC" checkbox under Project > Table of Contents. However, un-checking this option removes both the "TOC" button AND the "Expand/Collapse" icons. Is it possible to remove just the "TOC" button in the playbar?

    If you are using SWF output you can always edit the playbar in Flash and remove it.
    If HTML5 you can edit the JavaScript out put to remove the button from the playbar.

  • How do I remove expand / collapse icon for JTree empty folders

    Hi
    I am using a JTree as a file system browser. I use DefaultMutableTreeNode nodes.
    I have a problem with empty folders.
    Empty folders show the expand / collapse icon, leading the user to believe there are sub-directories. When the user double-clicks the folder, the expand / collapse icon goes away. This is a "haha-gotcha" glitch that I really don't want my users to have to continually deal with.
    So, how might I get my JTree to not show the expand / collapse icon for empty folders?
    Thanks
    Wayne

    Maybe I can use the FileSystemView isTraversable(File f) method in my TreeCellRenderer class to check if anything is in the directory.
    But I still need to know how to disable the expand / collapse icon for such a node.

  • Change behaviour of Expand/collapse icon in JTree

    Want to change the behaviour of Expand/collapse icon in a JTree. Need help with the same. Thanks.

    Check: Hide and show region

  • Show 'Expand'/'Collapse' Icon in Tray

    Hi All,
              I have done the following configuration in the portal and the result is confusing, can you please help me understand why?
    1. I have created 2 pages, first is a standard portal page and second a webdynpro page in a test folder
    2. copied a standard SAP iView to the test folder and added it to both the pages as a delta link
    3. opened the iview property from the std. page and set the "Show u2018Expandu2019/u2019Collapseu2019 Icon in Tray" property to NO
    4. opened the iview property from the webdynpro page and set the "Show u2018Expandu2019/u2019Collapseu2019 Icon in Tray" property to NO
    When i preview the standard page the iView appears without the "Expand/Collapse" icon, but when i preview the webdynpro page the iview appears with the "Expand/Collapse" icon.
    Thanks,
    Anand

    Hi Raghu,
                   Our portal version is 7.01 SPS15.
    Hi All,
             Any suggestions?
    Edited by: Kirupanand Venkatapathi on Oct 4, 2010 11:32 AM

  • Remove/hide expand/collapse icons

    Hi,
    I would like to remove/hide the expand/collapse icons and have a fixed navigation iView.
    Thanks in advance.
    Rgds,
    Janvi

    Hi Janvi,
    Probably to hide the collapse and expand icon you could go about with the theme editor , where u can set the url to these images as some blank image that coincides with ur background colour.
    To have a fixed navigation panel without scrolling ,probably you can change the the width of the navigation panel by changing the value defaultExpWidth in the file WAandNAVPanel.js file in the par file com.sap.layouts.framework.par from 220 pixels to a higher value.Later u need to upload the file back and restart ur system.
    Hope this helps,
    Regards,
    Uma.

  • JTree remove expand/collapse cross button...??

    Hi all,
    I have forbidden tree collapsing (by default it is fully expanded),
    and I want to remove expand/collapse cross buttons that actually are used to expand/collapse tree nodes.
    Is it possible and can anyone give me advice how i can do this.
    Thanks in advance.

    I tried extending the BasicTreeUI to return nulls for the collapsed and exapnded icons as shown in the code below. For the most part, it works great! However, one can still expand/collapse the tree by clicking on the point where the vertical and horizontal lines connect.
    I guess some one else will take over from here.
    import java.awt.BorderLayout;
    import javax.swing.Icon;
    import javax.swing.JFrame;
    import javax.swing.JScrollPane;
    import javax.swing.JTree;
    import javax.swing.WindowConstants;
    import javax.swing.plaf.basic.BasicTreeUI;
    import javax.swing.tree.DefaultMutableTreeNode;
    public class Temp extends JFrame {
         private JTree tree = null;
         public Temp() {
              super("Test");
              setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
              initComponents();
              pack();
              setVisible(true);
         private void initComponents() {
              DefaultMutableTreeNode rootNode =
                   new DefaultMutableTreeNode("User Preferences", true);
              DefaultMutableTreeNode connectionSettingsNode =
                   new DefaultMutableTreeNode("Connection Settings", true);
              DefaultMutableTreeNode sslNode =
                   new DefaultMutableTreeNode("SSL", false);
              DefaultMutableTreeNode firewallNode =
                   new DefaultMutableTreeNode("Firewall", false);
              DefaultMutableTreeNode securityNode =
                   new DefaultMutableTreeNode("Security", true);
              DefaultMutableTreeNode serverCertificatesNode =
                   new DefaultMutableTreeNode("Server Certificates", false);
              DefaultMutableTreeNode clientCertificatesNode =
                   new DefaultMutableTreeNode("Client Certificates", false);
              connectionSettingsNode.add(sslNode);
              connectionSettingsNode.add(firewallNode);
              securityNode.add(serverCertificatesNode);
              securityNode.add(clientCertificatesNode);
              rootNode.add(connectionSettingsNode);
              rootNode.add(securityNode);
              tree = new JTree(rootNode);
              JScrollPane scroller = new JScrollPane(tree);
              getContentPane().add(scroller, BorderLayout.CENTER);
              tree.setUI(new MyTreeUI());
              //tree.setShowsRootHandles(false);
         public static void main(String args []) {
              new Temp();
         class MyTreeUI extends BasicTreeUI {
              public Icon getCollapsedIcon() {
                   return null;
              public Icon getExpandedIcon() {
                   return null;
    }Sai Pullabhotla

  • How to hide Expand/ Collapse icon from ADF Query Panel.

    Hi Experts,
    I need to hide the expand collapse button from the ADF Query panel.
    is there any way to hide it.
    Please help me.
    Thanks in Advance.
    Balaji,

    Hi Balaji,
    Create a CSS file and the below code
    af|query.CustomQueryPanel::disclosure-icon-container { background-image: url("../img/minus.png"); display:none; height:0px; width:0px; }
    af|query.CustomQueryPanel::disclosed-icon { display:none; }
    af|query.CustomQueryPanel::undisclosed-icon { display:none; }
    Add styleClass="CustomQueryPanel" inside <af:query...>
    Now you can try...:)
    Thanks
    Prabhat

  • Problem with JTree while expanding/collapsing a node

    Hi,
    I'm using a JTree for displaying the file system.
    Here, i want that whenever a node get expanded,
    it should show the latest files/directories under that node.
    Now, what i'm doing is, getting all the files/dir's using files.listFiles(),
    under that node and then creating a new node and adding it to parent (all in expand() method).
    But, now the problem is, while doing this whenever the parent node get expanded its adding all the latest files/dirs into the previous instance
    resulting the same file/dir is displaying twice,thrice.. and so on, as that node is expanded and collapsed.
    i tried removeAllChildren() in collapse() method but then that node is notexpanding at all .
    Can anybody help me please...
    i got stuck b'coz of this only.
    Thanks...

    Now what i'm doing is every time expand() get called,
    i'm comparing all the children of that node in the
    current instance with all the children present in the
    file system (because there is a possibility that some
    file/dir may be added or deleted)
    is this the right wy or not?it certainly is not wrong, but as usual, there is more than 1 way to implement this...
    b'coz right now i'm getting all the files/dirs that
    are newly added but facing some problem if somebody
    deletes a file/dir.
    i'm still trying to get the solutionthen you should not just compare all the children of the node with the files/dirs but also the other way round. compare the files/dirs with the children to determine if the file/dir still exists and if not remove the node.
    or you could check if the file which a node represents exists and if not remove the node.
    thomas

  • Detailed Navigation (disable expand./collapse icons opening tree

    Hi,
    I would like to adjust the detailed navigation as this site performs with having no action when clicking the +/- icons.
    Please can someone point me in the right direction.  I have been able to get the detailed navigation.par file out and look at the jsp code, but not sure where this requires a change.
    Will reward points for a helpful answer....
    Kai

    If I am reading your question correctly, you want to create a detailed navigation similar to SDN so that when you click on the expand/collapse icon it doesn't do a server round trip.
    Firstly I believe that the standard one performs a round trip to retrieve the nodes underneath the one that you have expanded.
    With SDN we created our own detailed navigation iview so that the entire navigation structure is loaded immediately. This is also the same if you use the standard light navigation iview I believe, so you could simply use this iview instead.
    I hope this helps
    Darrell

  • Expand/Collapse a block in a selection screen

    Hey Folks,
    I have a requirement , where I have a selection screen, with 3 selection blocks. I have a requirement that I need to make 2 of these blocks expandible/collapsible on the toggle of a button.. How can this be achieved.
    In case of a normal screen, I would have had to create the blocks as subscreens (one type of screen for expanded state...another for collapsed state) and called it from the main screen. But how do I achieve the same using the selection screens?
    I was considering creating the blocks as subscreens in the selection screen and calling them in the PBO of the main selection screen. However, I am unsure if thats a wise thing to do since the screen is generated automatically in case of a selection screen and I do believe its not a good idea to manually alter it.
    Does anyone has any pointers on this?
    Thanks and Best Regards,
    Puja.

    Hi,
    I have modified the code to show the expand/collapse ICON accordingly..Please check..
    TABLES sscrfields.
    TYPE-POOLS icon.
    * Expand/collapse buttons.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN PUSHBUTTON 2(23)  b1 USER-COMMAND usr1.
    SELECTION-SCREEN END OF LINE.
    * Block 1
    SELECTION-SCREEN BEGIN OF BLOCK b1.
    PARAMETERS: p_test1 TYPE char10  MODIF ID m1,
                p_test2 TYPE char10  MODIF ID m1.
    SELECT-OPTIONS  s_date  FOR sy-datum MODIF ID m1.
    SELECTION-SCREEN END OF BLOCK b1.
    * Block 2
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN PUSHBUTTON 2(23)  b2 USER-COMMAND usr2.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF BLOCK b2.
    PARAMETERS: p_test3 TYPE char10  MODIF ID m2,
                p_test4 TYPE char10  MODIF ID m2.
    SELECTION-SCREEN END OF BLOCK b2.
    * Declarations
    DATA: v_flag, v_flag1.
    INITIALIZATION.
      b1 = 'Button1'.
      b2 = 'Button2'.
      v_flag = 'X'.
      v_flag1 = 'X'.
    AT SELECTION-SCREEN.
    * Check the user command.
      IF sy-ucomm = 'USR1'.
        IF v_flag IS INITIAL.
          v_flag = 'X'.
        ELSE.
          CLEAR v_flag.
        ENDIF.
      ELSEIF sy-ucomm = 'USR2'.
        IF v_flag1 IS INITIAL.
          v_flag1 = 'X'.
        ELSE.
          CLEAR v_flag1.
        ENDIF.
      ENDIF.
    AT SELECTION-SCREEN OUTPUT.
      IF v_flag1 = 'X'.
        CALL FUNCTION 'ICON_CREATE'
          EXPORTING
            name   = icon_expand
            text   = 'Button 2'
            info   = 'Button 2'
          IMPORTING
            RESULT = b2
          EXCEPTIONS
            OTHERS = 0.
      ELSEIF v_flag1 IS INITIAL.
        CALL FUNCTION 'ICON_CREATE'
          EXPORTING
            name   = icon_collapse
            text   = 'Button 2'
            info   = 'Button 2'
          IMPORTING
            RESULT = b2
          EXCEPTIONS
            OTHERS = 0.
      ENDIF.
      IF v_flag = 'X'.
        CALL FUNCTION 'ICON_CREATE'
          EXPORTING
            name   = icon_expand
            text   = 'Button 1'
            info   = 'Button 1'
          IMPORTING
            RESULT = b1
          EXCEPTIONS
            OTHERS = 0.
      ELSEIF v_flag IS INITIAL.
        CALL FUNCTION 'ICON_CREATE'
          EXPORTING
            name   = icon_collapse
            text   = 'Button 1'
            info   = 'Button 1'
          IMPORTING
            RESULT = b1
          EXCEPTIONS
            OTHERS = 0.
      ENDIF.
      LOOP AT SCREEN.
    * Expand collapse block1
        IF v_flag = 'X' AND screen-group1 = 'M1'.
          screen-active = 0.
        ELSEIF v_flag IS INITIAL AND screen-group1 = 'M1'.
          screen-active = 1.
        ENDIF.
    * Expand collapse block2
        IF v_flag1 = 'X' AND screen-group1 = 'M2'.
          screen-active = 0.
        ELSEIF v_flag1 IS INITIAL AND screen-group1 = 'M2'.
          screen-active = 1.
        ENDIF.
        MODIFY SCREEN.
      ENDLOOP.
    Thanks
    Naren

  • Expand/Collapse option in Portal - SP13

    Hi everybody!!
    We have EP7.0 NetWeaver 2004s and we upgraded the SP from 5 to 13.  When SP13 was installed, the icon to expand/collapse doesn't work correctly (Detail Navigation in Navigation Panel in the Light Framework).  The icon always send the user to the main and first page.  With the SP5 it works well.
    Do you have any idea about how can I solve this??
    Thanks in advance for any help that you can give me!
    Best Regards,
    Claudia

    Hi Claudia,
    Take a look at this thread maybe it gives you some answers...
    How to disable automatic loading of iView/Page in detailed navigation?
    We have SP13 at this moment and its working "fine":
    1. When clicking on the expand/collapse icon (the triangle) the first navigation node in this folder/workset is NOT loaded automatically.
    2. When clicking on the text part of the link (the actual url) the first navigation node in this folder/workset IS loaded.
    In addition to step 2 you can steer what navigation node is loaded by setting the parameter "Default Entry for Folder" this property is by default set to No.
    Also take a look at the property: "Clicking Folder Name Launches First Node" of the Detailed Navigation iView.. Maybe this is by some reason got set properly...
    Good Luck,
    Benjamin Houttuin

  • Expand/Collapse function in WAD 7.0

    Hi,
    I have made a report in WAD using a table and a chart. In the output which I am running on a portal I have a table Report Navigation with  in which I have some of the export options and an Expand / Collapse icons are present on the button group and also I have one drop down box calendar year .As soon as I click on the icon Collapse in  the above table Report Navigation my drop down should get collapsed and again when I click on the Expand the drop down should be visible
    Report naviagtion and  Drop down boxes are present in a seperate table where in when I click on the icons( Expand / Collapse ) it should get reflected on the dropdown box which is present on the 2nd table
    I have done the above in WAD 3.5 using Java script Code
    How can this be done in WAD 7.0
    Regards,
    Maya

    Hi,
    After setting the Analysis item properties, just click on the 7th icon on top menu bar, i think its Verify or Check on server. Somthing like that.
    Or try re-opening the template after sometime. Close the existing Web window, where you see your output, and execute the template once again. This should work.
    If nothing of the above works, theres one more thing. You may have to re-create the Template.
    This happens at times when there is no proper connection between the Portal and WAD. I have faced it myself. So, just try something like that.

  • Trying to override the default af:tree expanded and collapsed icons

    Hi,
    I initially hijacked a thread from 2010 that was vaguely similar to what I need to ask, but a kind forum moderator split my post out to stand on its own merits.
    I am trying to override the default af:tree expanded and collapsed icons I am using the following styles for my af:tree but they are not reflecting any thing on my tree with the styleclass orgType.
    af|tree.orgType::expanded-icon {
    content: url("../images/ac-expand.png");
    cursor: default;
    af|tree.orgType::collapsed-icon {
    content: url("../images/ac-collapsed.png");
    cursor: default;
    af|tree::expanded-icon {
    content: url("../images/folder_open.png");
    cursor: default;
    af|tree::collapsed-icon {
    content: url("../images/folder_close.png");
    cursor: default;
    After working for long hours I realized that there is some problem with af:tree and treeTable. They are not taking the styles where as for the other components, every thing works fine. Is there any way to achieve the task. Could you suggest any alternative way to do this. Thanks in advance. Your suggestions for this task can really help me and my team a lot.
    Regards,
    Krishna Sumanth.

    Hi,
    do the icons show without the style class reference used in the skin file? If so, then the style class for this component might be rendered differently for the tree, e.g.
    .orgType af|tree ...
    Frank

  • JTree with XML content expand/collapse problem

    Hello all,
    I'm having this very weird problem with a JTree I use to display the contents of an XML file. I use the DOM parser (and not JDOM since I want the application to run as an applet as well, and don't want to have any external libraries for the user to download) and have a custom TreeModel and TreeNode implementations to wrap the DOM nodes so that they are displayed by the JTree.
    I have also added a popup menu in the tree, for the user to be able to expand/collapse all nodes under the selected one (i.e. a recursive method).
    When expandAll is run, everything works fine and the children of the selected node are expanded (and their children and so on).
    However, after the expansion when I run the collapseAll function, even though the selected node collapses, when I re-expand it (manually not by expandAll) all of it's children are still fully open! Even if I collapse sub-elements of the node manually and then collapse this node and re-expand it, it "forgets" the state of it's children and shows them fully expanded.
    In other words once I use expandAll no matter what I do, the children of this node will be expanded (once I close it and re-open it).
    Also after running expandAll the behaviour(!) of the expanded nodes change: i have tree.setToggleClickCount(1); but on the expanded nodes I need to double-click to collapse them.
    I believe the problem is related to my implementations of TreeModel and TreeNode but after many-many hours of trying to figure out what's happening I'm desperate... Please help!
    Here's my code:
    public class XMLTreeNode implements TreeNode 
         //This class wraps a DOM node
        org.w3c.dom.Node domNode;
        protected boolean allowChildren;
        protected Vector children;
        //compressed view (#text).
         private static boolean compress = true;   
        // An array of names for DOM node-types
        // (Array indexes = nodeType() values.)
        static final String[] typeName = {
            "none",
            "Element",
            "Attr",
            "Text",
            "CDATA",
            "EntityRef",
            "Entity",
            "ProcInstr",
            "Comment",
            "Document",
            "DocType",
            "DocFragment",
            "Notation",
        static final int ELEMENT_TYPE =   1;
        static final int ATTR_TYPE =      2;
        static final int TEXT_TYPE =      3;
        static final int CDATA_TYPE =     4;
        static final int ENTITYREF_TYPE = 5;
        static final int ENTITY_TYPE =    6;
        static final int PROCINSTR_TYPE = 7;
        static final int COMMENT_TYPE =   8;
        static final int DOCUMENT_TYPE =  9;
        static final int DOCTYPE_TYPE =  10;
        static final int DOCFRAG_TYPE =  11;
        static final int NOTATION_TYPE = 12;
        // The list of elements to display in the tree
       static String[] treeElementNames = {
            "node",
      // Construct an Adapter node from a DOM node
      public XMLTreeNode(org.w3c.dom.Node node) {
        domNode = node;
      public String toString(){
           if (domNode.hasAttributes()){
                return domNode.getAttributes().getNamedItem("label").getNodeValue();
           }else return domNode.getNodeName();      
      public boolean isLeaf(){ 
           return (this.getChildCount()==0);
      boolean treeElement(String elementName) {
          for (int i=0; i<treeElementNames.length; i++) {
            if ( elementName.equals(treeElementNames)) return true;
    return false;
    public int getChildCount() {
         if (!compress) {   
    return domNode.getChildNodes().getLength();
    int count = 0;
    for (int i=0; i<domNode.getChildNodes().getLength(); i++) {
    org.w3c.dom.Node node = domNode.getChildNodes().item(i);
    if (node.getNodeType() == ELEMENT_TYPE
    && treeElement( node.getNodeName() ))
    // Note:
    // Have to check for proper type.
    // The DOCTYPE element also has the right name
    ++count;
    return count;
    public boolean getAllowsChildren() {
         // TODO Auto-generated method stub
         return true;
    public Enumeration children() {
         // TODO Auto-generated method stub
         return null;
    public TreeNode getParent() {
         // TODO Auto-generated method stub
         return null;
    public TreeNode getChildAt(int searchIndex) {
    org.w3c.dom.Node node =
    domNode.getChildNodes().item(searchIndex);
    if (compress) {
    // Return Nth displayable node
    int elementNodeIndex = 0;
    for (int i=0; i<domNode.getChildNodes().getLength(); i++) {
    node = domNode.getChildNodes().item(i);
    if (node.getNodeType() == ELEMENT_TYPE
    && treeElement( node.getNodeName() )
    && elementNodeIndex++ == searchIndex) {
    break;
    return new XMLTreeNode(node);
    public int getIndex(TreeNode tnode) {
         if (tnode== null) {
              throw new IllegalArgumentException("argument is null");
         XMLTreeNode child=(XMLTreeNode)tnode;
         int count = getChildCount();
         for (int i=0; i<count; i++) {
              XMLTreeNode n = (XMLTreeNode)this.getChildAt(i);
              if (child.domNode == n.domNode) return i;
         return -1; // Should never get here.
    public class XMLTreeModel2 extends DefaultTreeModel
         private Vector listenerList = new Vector();
         * This adapter converts the current Document (a DOM) into
         * a JTree model.
         private Document document;
         public XMLTreeModel2 (Document doc){
              super(new XMLTreeNode(doc));
              this.document=doc;
         public Object getRoot() {
              //System.err.println("Returning root: " +document);
              return new XMLTreeNode(document);
         public boolean isLeaf(Object aNode) {
              return ((XMLTreeNode)aNode).isLeaf();
         public int getChildCount(Object parent) {
              XMLTreeNode node = (XMLTreeNode) parent;
    return node.getChildCount();
         public Object getChild(Object parent, int index) {
    XMLTreeNode node = (XMLTreeNode) parent;
    return node.getChildAt(index);
         public int getIndexOfChild(Object parent, Object child) {
    if (parent==null || child==null )
         return -1;
              XMLTreeNode node = (XMLTreeNode) parent;
    return node.getIndex((XMLTreeNode) child);
         public void valueForPathChanged(TreePath path, Object newValue) {
    // Null. no changes
         public void addTreeModelListener(TreeModelListener listener) {
              if ( listener != null
    && ! listenerList.contains( listener ) ) {
    listenerList.addElement( listener );
         public void removeTreeModelListener(TreeModelListener listener) {
              if ( listener != null ) {
    listenerList.removeElement( listener );
         public void fireTreeNodesChanged( TreeModelEvent e ) {
    Enumeration listeners = listenerList.elements();
    while ( listeners.hasMoreElements() ) {
    TreeModelListener listener =
    (TreeModelListener) listeners.nextElement();
    listener.treeNodesChanged( e );
         public void fireTreeNodesInserted( TreeModelEvent e ) {
    Enumeration listeners = listenerList.elements();
    while ( listeners.hasMoreElements() ) {
    TreeModelListener listener =
    (TreeModelListener) listeners.nextElement();
    listener.treeNodesInserted( e );
         public void fireTreeNodesRemoved( TreeModelEvent e ) {
    Enumeration listeners = listenerList.elements();
    while ( listeners.hasMoreElements() ) {
    TreeModelListener listener =
    (TreeModelListener) listeners.nextElement();
    listener.treeNodesRemoved( e );
         public void fireTreeStructureChanged( TreeModelEvent e ) {
    Enumeration listeners = listenerList.elements();
    while ( listeners.hasMoreElements() ) {
    TreeModelListener listener =
    (TreeModelListener) listeners.nextElement();
    listener.treeStructureChanged( e );
    The collapseAll, expandAll code (even though I m pretty sure that's not the problem since they work fine on a normal JTree):
        private void collapseAll(TreePath tp){
             if (tp==null) return;
             Object node=tp.getLastPathComponent();
             TreeModel model=tree.getModel();
             if (!model.isLeaf(node)){
                  tree.collapsePath(tp);
                  for (int i=0;i<model.getChildCount(node);i++){
                  //for (int i = node.childCount()-4;i>=0;i--){
                       collapseAll(tp.pathByAddingChild(model.getChild(node,i)));
                  tree.collapsePath(tp);
        private void expandAll(TreePath tp){
             if (tp==null) return;
             Object node=tp.getLastPathComponent();
             TreeModel model=tree.getModel();
             if (!model.isLeaf(node)){
                  tree.expandPath(tp);
                  for (int i=0;i<model.getChildCount(node);i++){
                  //for (int i = node.childCount()-4;i>=0;i--){
                       expandAll(tp.pathByAddingChild(model.getChild(node,i)));

    Hi,
    Iam not facing this problem. To CollapseAll, I do a tree.getModel().reload() which causes all nodes to get collapsed and remain so even if I reopen them manually.
    Hope this helps.
    cheers,
    vidyut

Maybe you are looking for