Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to load email folder list into jTree?

 
austin hoh
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


the Code above is i store the folder into a jList but i wanted to add into a jTree. Hope able to get help on this. Thanks in advance
 
Rob Camick
Ranch Hand
Posts: 2674
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out the section from the Swing tutorial on How to Use Trees for an example that shows how to add nodes to the tree.

Also, you basic logic for the JList is not the most efficient.

In your loop you would add the items to the ListModel. Then outside the loop you would set the model to the list. There is no need to set the model for every item.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic