Link to home
Start Free TrialLog in
Avatar of iAwin
iAwin

asked on

add node border lines to jtree that has windows look and feel


Hi all,

I have a jtree with the windows look and feel, im just wondering how can I add the lines between the various nodes. By lines I mean that in the java look and feel when a node is expanded a vertical and horizantal line appears to indicated the new nodes location.

Thanks
ASKER CERTIFIED SOLUTION
Avatar of zzynx
zzynx
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Remark: I don't see the lines when running on java 1.4.2
              I do see them when running on java 1.5
Avatar of iAwin
iAwin

ASKER


Thats perfect zzynx, thanks.

Im just confused as to how you found that out cos i did'nt see the putClientProperty anywhere in the jrett docs?
Avatar of iAwin

ASKER


>>jrett docs?

jtree docs
>> i did'nt see the putClientProperty anywhere in the jrett docs?
putClientProperty() is a method of JComponent (and a JTree is also a JComponent)

It's mentioned in the link I gave you
Avatar of iAwin

ASKER


sorry, let me pre - phrase, The properties "JTree.lineStyle", "Angled" are not mentioned in the docs?
Avatar of iAwin

ASKER


The reason I ask is that I may want to change the appearance and id just like to know where to look for different properties...
>> id just like to know where to look for different properties
afaik, the link I gave you tells it all
I mean: afaik, that's all there is
Well, when @ http://www.rgagnon.com/javadetails/JavaUIDefaults.txt you search for "Tree"
you'll see that some other things can be changed too.
But when changing those you change them for ALL your JTree's.

e.g.
UIManager.put("Tree.font", new Font("Serif", Font.ITALIC, 12));
Avatar of iAwin

ASKER


ok, ;-) thanks
Thanx 4 axxepting
Avatar of iAwin

ASKER


>>But when changing those you change them for ALL your JTree's.

How do you mean?
yourTree.putClientProperty("JTree.lineStyle", "Angled");

only influences the JTree instance yourTree.

while calling

UIManager.put("Tree.font", new Font("Serif", Font.ITALIC, 12));

influences all JTree instances you use in your app



Avatar of iAwin

ASKER


oh ok, thanks again
No problem
Thanks zzynx, I was also eager to learn about this.
;JOOP!
You're welcome
;°)