-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hello:
I don't understand how addOpenPath() and addOpenPaths() works. I have a populated tree with a with a three elements model. Doing
AbstractTreeModel t = (AbstractTreeModel)tree.getModel(); t.addOpenPath(new int[]{1});
opens second element, but doing:
AbstractTreeModel t = (AbstractTreeModel)tree.getModel(); t.addOpenPath(new int[]{0,1,2});
opens no one.
What I'm doing wrong?
Ahh. Ok. I understand.
Thank you.
The argument you pass to the addOpenPath() method is a tree path.
If the three element in your tree model are both sibling, we should invoke TreeOpenableModel.addOpenPaths(new int[][]{{0}, {1}, {2}}) to open them.
Asked: 2012-06-19 15:37:23 +0800
Seen: 158 times
Last updated: Jul 26 '12