This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Sort the elements in Tree in SWT Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Sort the elements in Tree in SWT" Watch "Sort the elements in Tree in SWT" New topic
Author

Sort the elements in Tree in SWT

Chethan Sharma
Ranch Hand

Joined: Mar 22, 2006
Posts: 59
Hi,

Can some one suggest me how to sort the elements in Tree view in swt.
any urls or some sample code is very useful for me.

Thanks in Advance,

Regards,


chaithu
Dhanya Palanisamy
Ranch Hand

Joined: Oct 20, 2006
Posts: 61
Hi Chethan,

Some more information is needed to answer your question. Sort means, what is your tree view now, what you want to change?
Chethan Sharma
Ranch Hand

Joined: Mar 22, 2006
Posts: 59
I want to sort the names by ascending or descedning order in a tree view.
Under Tree View
--- xxx
----bbb
----jjj

the result should be in
-- bbb
--jjj
---xxx
Thanks,
Dhanya Palanisamy
Ranch Hand

Joined: Oct 20, 2006
Posts: 61
http://forum.java.sun.com/thread.jspa?threadID=189640&messageID=1408664

hope this is useful
Chethan Sharma
Ranch Hand

Joined: Mar 22, 2006
Posts: 59
Thanks for you reply.

I need to sort the names(childrens) in a tree view.(in SWT)
Would you please provide info on SWT
Dhanya Palanisamy
Ranch Hand

Joined: Oct 20, 2006
Posts: 61
Try to use a JFace Tree Viewer - view sorter.
check here:
http://www.eclipse.org/articles/Article-TreeViewer/TreeViewerArticle.htm
 
 
subject: Sort the elements in Tree in SWT