Here you can find the source of setTreeObjects(TreeModel in, Object root, Object[] items, int index)
Parameter | Description |
---|---|
in | - the tree model |
protected static int setTreeObjects(TreeModel in, Object root, Object[] items, int index)
//package com.java2s; //License from project: Apache License import javax.swing.tree.*; public class Main { /**/* w ww .j a v a2 s . com*/ return the objects in a tree modes as a simple array @param in - the tree model @parem root - starting node - non-null @parem items - array of Objects @parem index - index on entry @return - index of first unused access */ protected static int setTreeObjects(TreeModel in, Object root, Object[] items, int index) { items[index++] = root; for (int i = 0; i < in.getChildCount(root); i++) index = setTreeObjects(in, in.getChild(root, i), items, index); return (index); } }