how to export jtree into text with all the indents of the trees ?

Hello,

I have a Jtree that I need to export it into text.

But I was wondering, is there a way to export only the expanded nodes with the indents that the tree has i.e:

John Mathew

John Smith

Carol Johnson

Al Bundy

Mark Reed

Monark Hertz

etc..............................

I was hoping to find a similar way to getValueAt for JTable but the indent formatting is hard to get.

Thank you very much for your time

and your interest and everything else,

cheers Al

[547 byte] By [altojavaa] at [2007-11-27 10:34:07]
# 1

sorry had to put this as code for formating:

John

Smith

Carol Johnson

Al Bundy

Mark Reed

Monark Hertz

altojavaa at 2007-7-28 18:26:54 > top of Java-index,Desktop,Core GUI APIs...
# 2

So when you recursively iterate over your tree model, you can keep track of the recursion depth. If you're using TreePath to iterate over your tree, it has the getPathCount method.

kirillga at 2007-7-28 18:26:54 > top of Java-index,Desktop,Core GUI APIs...