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.

2 Answers 2

1

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

Sign up to request clarification or add additional context in comments.

Comments

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.