This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Journey To Enterprise Agility and have Daryl Kulak & Hong Li on-line!
See this thread for details.
Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

generate a tree structure  RSS feed

 
Ranch Hand
Posts: 152
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi guys,
i want to generate the tree structure of directory. e.g. if directory is home and it has many sub directory i want to display all the sub-directories in a directory and so on till all are display. i am able to find out the directory. but the problem is how should i trace in until the last directory in a directory. like home/a/b/c/d..... until all the directories are exhausted.
 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Think recursively
Just consider one level at a time. Display contents of a node and then (recursively) for all its children (sub-dir) call this same method.
 
Rancher
Posts: 42975
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you asking about a web GUI or a Java GUI?
 
Pravin Shirke
Ranch Hand
Posts: 152
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi ulf,
i am using java GUI Swings API for that.
 
Ranch Hand
Posts: 266
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

pravin shirke wrote:hi ulf,
i am using java GUI Swings API for that.



Have a look at this article:
http://java.sun.com/products/jfc/tsc/articles/treetable1/index.html
and/or:
http://java.sun.com/docs/books/tutorial/uiswing/components/tree.html
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!