i want to assign a multidimensional array to jtree. how can i do this?
here is sample of an array:
ROOT:{ FolderA : {FileA,FileB} , FolderB: {FileA,FileB} } ....
Also i want to determine files and assign icon to them.
i want to assign a multidimensional array to jtree. how can i do this?
here is sample of an array:
ROOT:{ FolderA : {FileA,FileB} , FolderB: {FileA,FileB} } ....
Also i want to determine files and assign icon to them.
Here's a nice article showing how to use org.netbeans.swing.outline.Outline
for this. There's more in this answer. Ordinary extensions of TableCellRenderer
or the RenderDataProvider
interface make it especially easy to customize the appearance of rows in the tree.
You must get model from your jtree and then operate on it. Here you have working example