File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes control the visiblity of a tree table node Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "control the visiblity of a tree table node" Watch "control the visiblity of a tree table node" New topic
Author

control the visiblity of a tree table node

KiCk CoDe
Greenhorn

Joined: Jun 09, 2005
Posts: 1
Hi all
My first post :
I have a requirement to control the visibility of a tree table node in a DefaultMutableTreeNode
I need to make the node in that tree table appear/disappear in some instances.
Is it possible?

thanks in advance.
Dhanya Palanisamy
Ranch Hand

Joined: Oct 20, 2006
Posts: 61
Yes, it is possible.

JTree tree = null;
//some code here
tree.setsetRootVisible(false);
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

"KiCk CoDe" -

Welcome to the JavaRanch! We don't have many rules around the ranch, but we do have a policy on displayed names... Please adjust your displayed name to meet the JavaRanch Naming Policy. User names cannot be obviously fake and must consist of a first name and a last name.

You can change your user name here.

Thanks! and welcome to the JavaRanch!


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

In the case of the TreeTable, nodes are also rows in the table...

Rather than thinking of this as "make[ing] the node in that tree table appear/disappear", think of it more as "filtering the data in my TreeTable". I think the best approach is probably going to be to make a wrapper for the model that your TreeTable uses and filter out the rows/nodes that don't meet whatever criteria you use to determine that the data doesn't need to be displayed.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: control the visiblity of a tree table node