{ TreeModel mod = tree.getModel();
{
	public int getRowCount(JTree tree)	{    TreeModel mod = tree.getModel();    int count = 0;    if (mod != null)      {        Object node = mod.getRoot();      if (!tree.isRootVisible()        && tree.isExpanded(new TreePath((getPathToRoot(node, 0)))))      node = getNextNode(node);            while (node != null)      {         count++;         node = getNextVisibleNode(node);      }      }      return count;	}