Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback, please email oracle-forums_moderators_us@oracle.com

JTree cell width question

843806Jan 8 2009 — edited Jan 23 2009
I'm trying to write a custom TreeCellRenderer that is sensitive to the visible width available to display the value. I can't use tree.getRowBounds(row) from within getTreeCellRendererComponent, because getRowBounds eventually calls getTreeCellRendererComponent again, resulting in stack overflow.

So how can I get hold of the visible row width (after depth-level indenting) from within getTreeCellRendererComponent?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 20 2009
Added on Jan 8 2009
11 comments
5,017 views