Jump to Real's How-to Main page

Show dotted lines in a JTree

In your code
...
tree.putClientProperty("JTree.lineStyle", "Angled");
...
Or from the command line
java -DJTree.lineStyle=Angled  MyApp
Other possible values :
None   
       No lines are drawn anywhere on the tree.
Angled 
       Vertical lines between nodes at the same level,
       horizontal line to child node.
Horizontal
       A single horizontal line between nodes immediately
       attached to the root node. This is the default setting.

See also List of undocumented properties to change the behavior of Swing in Suns JVM.


If you find this article useful, consider making a small donation
to show your support for this Web site and its content.

Written and compiled by Réal Gagnon ©1998-2005
[ home ]