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