• Post Reply Bookmark Topic Watch Topic
  • New Topic

JTree and windows directories  RSS feed

 
Jennifer Sohl
Ranch Hand
Posts: 455
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi. I need to create a JTree dialog to come up when a user clicks on a "browse" button I have created for them. I need the JTree to be populated with all of the directories in windows on their system.
Can anyone nudge me in the right direction on how to get this information and put it into a JTree??
Thanks.
 
Chantal Ackermann
Ranch Hand
Posts: 508
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
you certainly know about JFileChooser? Wouldn't it spare you lots of work?
If you don't want to use it you could read through its source code to see how they're doing things.
Otherwise you need to write your own TreeModel and TreeNode implementation. Which shouldn't be that difficult as the File class behaves similar to a TreeNode.
Chantal
[ January 08, 2003: Message edited by: Chantal Ackermann ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!