By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,190 Members | 765 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,190 IT Pros & Developers. It's quick & easy.

Expanding and Collapsing JTree

P: n/a
Hello Everybody,

I am trying to write a file Explorer program in Java, i go the Frame, Basic
Menu and Tree going. But now i have the C: listed and i need some help
expanding and collaping the HDD to se Folders and Files contained in there
C:..

Help is greatly apprciated..

Thanks
--Rahsaan
Oct 9 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Rahsaan Page wrote:
Hello Everybody,

I am trying to write a file Explorer program in Java, i go the Frame, Basic
Menu and Tree going. But now i have the C: listed and i need some help
expanding and collaping the HDD to se Folders and Files contained in there
C:..

Help is greatly apprciated..

Thanks
--Rahsaan

You should probably implement a TreeNode extended class to wrap
java.io.File objects and implement the TreeWillExpandListener. Then when
you get the treeWillExpand event you check which File object the user is
trying to expand and then just list the files under that object,
creating TreeNode objects for each and tell the tree that the node has
been updated.
Oct 10 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.