1

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.

ShirazITCo
  • 1,041
  • 6
  • 23
  • 38

2 Answers2

1

You must get model from your jtree and then operate on it. Here you have working example

lukastymo
  • 26,145
  • 14
  • 53
  • 66
0

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.

Community
  • 1
  • 1
trashgod
  • 203,806
  • 29
  • 246
  • 1,045