|
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?
|