How to make treenode name/text NOT wrap?

I dynamically add tree nodes to my tree.

The problem I have is if the node being added has longer name than the width of the tree component; the tree node text /name wraps to the next line and my tree looks very ugly.

To reproduce this problem you can use the 'DynamicTree' sample that comes with the IDE. Try typing too long name and click 'ADD' and you will see the wrapping problem.

Any solution to this problem?

I want the tree to overflow and scroll bars appear whenever the treenode name is too long rather than wrapping.

I tried to set the Style class of every treenode being added to :

Overflow : auto

white-space : nowrap

but does NOT do the trick.

Any ideas/help greatly appreciated!!

-Rolla

Message was edited by:

RollaTomasi

[821 byte] By [RollaTomasi] at [2007-11-26 11:02:48]
# 1
See this thread: http://forum.sun.com/jive/thread.jspa?forumID=123&threadID=64242
Rradhika at 2007-7-7 3:16:38 > top of Java-index,Development Tools,Java Tools...
# 2
Radhika Thanks.Yes the trick is to set the width property to be stupidly long in a styleclass and then set that styleclass to every tree node that is added dynamically to the tree.Cheers...-Rolla
RollaTomasi at 2007-7-7 3:16:38 > top of Java-index,Development Tools,Java Tools...