Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

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,206 views