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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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?
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
putClientProperty() is a method of JComponent (and a JTree is also a JComponent)
It's mentioned in the link I gave you
ASKER
sorry, let me pre - phrase, The properties "JTree.lineStyle", "Angled" are not mentioned in the docs?
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
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));
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",
ASKER
ok, ;-) thanks
Thanx 4 axxepting
ASKER
>>But when changing those you change them for ALL your JTree's.
How do you mean?
yourTree.putClientProperty ("JTree.li neStyle", "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
only influences the JTree instance yourTree.
while calling
UIManager.put("Tree.font",
influences all JTree instances you use in your app
ASKER
oh ok, thanks again
No problem
Thanks zzynx, I was also eager to learn about this.
;JOOP!
;JOOP!
You're welcome
;°)
;°)
I do see them when running on java 1.5