Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Java (http://www.programmingforums.org/forum17.html)
-   -   Drawing Trees in with Swing (http://www.programmingforums.org/showthread.php?t=12457)

hoffmandirt Jan 29th, 2007 9:24 AM

Drawing Trees in with Swing
 
I want to display a tree in a Java GUI, but I am not sure how to handle the spacing of the nodes as the tree gets deeper. I have the internal representation of the tree. It's no more than simple tree laying out a wireless LAN bridge topography. I now need to display this to the user. I have read that the Canvas class is the best class to use for drawing, but I am fairly new to Java and I am not sure why. Is it set up on Cartesian coordinates? Does anyone have a formula off the top of their head that can calculate the spacing of the nodes so they don't overlap each other?

hoffmandirt Feb 22nd, 2007 4:36 PM

I found a nice third party package for this stuff. http://prefuse.org/

pushkarajthorat Oct 1st, 2008 2:58 AM

Re: Drawing Trees in with Swing
 
Quote:

Originally Posted by hoffmandirt (Post 124279)
I found a nice third party package for this stuff. http://prefuse.org/

a good lib.


All times are GMT -5. The time now is 1:47 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC