I am looking for a way to create a nested tree structure in my GUI. I have a few "boxes" that have items in them. I would like the boxes to be collapsed but expanded when clicked on, like the way folders are navigated on the sidebar. The first way I considered was treating the "boxes" as JList, with the items in each box stored in a nested JList. This seems like a very complicated and poor way of doing it. It also prevents the boxes from being collapsible without extensive modifications to the actionlistener. I was hoping someone might know of an API perhaps for displaying file navigation that might be used here.
Looks good but you should expand the comment a bit.
Mark Carey
2009-12-16 04:09:21
+2
A:
It sounds like you are looking for JTree. There is a tutorial on using JTree.
vkraemer
2009-12-16 04:16:19