JTree with dynamically adjusted row height during editing.  
Author Message
benson.bear





PostPosted: 2006-3-27 13:01:00 Top

java-programmer, JTree with dynamically adjusted row height during editing. I have extended JTable so that the installed editor for a cell checks
at each keystroke whether it must adjust the row height in order to fit
the content in the cell. This is easy to do with a document listener
which just starts a thread on each insertion to check for a height
change, and then calls setRowHeight on the appropriate row.

However, it does not seem to be so simple to do the same thing with a
JTree. setRowHeight cannot be called on a specific row, and with
rowHeight set to 0, the tree cells are only resized when the tree
manager itself queries the height. There does not appear to be a way
to get the editor to do this directly.

Does anyone know how to get this effect? It allows for something much
like a regular text outliner using JTree and I would think lots of
people would have wanted to do this in the past, but I havent found
evidence that it has been done.