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!

JTree cell width

800349Dec 26 2009 — edited Dec 27 2009
Hiya

I'm trying to make my jtree's cell width be equal to the width of the entire JTree it is in so that when selected, a highlight bar stretches across the entire jtree rather than just around the text of that node?
I've created a DefaultTreeCellRenderer and attached it to the jtree, and tried overriding the getWidth, getPreferredSize, getBounds, but I can't get it working.

How can I do this?
Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 24 2010
Added on Dec 26 2009
6 comments
292 views