• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to draw a tree

 
shalini gnana
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have to draw tree in applet without using the JTree Class..Can a anyone help me?

 
Craig Wood
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want the same thing as a JTree you can have a look at the JTree source code (in the src folder of your sdk) to get some ideas. If you want to draw lines of indented strings and/or images you can draw these in the paintComponent method of a JPanel. If you want something like a binary tree you can find examples in the demo folder of your sdk: look for the GraphLayout folder.
 
shalini gnana
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't want to use the tree class..I need to use only the graphics to draw my own tree..
 
Craig Wood
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
shalini gnana
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to group all the child and roll-up all parents..Is there any method for it?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!