View Single Post
Old Jan 29th, 2007, 9:24 AM   #1
hoffmandirt
Hobbyist Programmer
 
hoffmandirt's Avatar
 
Join Date: Jul 2005
Location: PA
Posts: 125
Rep Power: 4 hoffmandirt is on a distinguished road
Send a message via AIM to hoffmandirt
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 is offline   Reply With Quote