• 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: 2714
10
  • 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.
 
And tomorrow is the circus! We can go to the circus! I love the circus! We can take this tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!