Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Drawing Tree  RSS feed

 
Vikas Kulkarni
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am in the process of creating a tree using java swings. By tree I dont mean the one that is created by JTree, I dont want the tree should be like folder structure.
I want to draw a tree which has root element and it may contain n number of children and those children may further contain n number of children. (So it is not binary tree too)

So, Is there any library already available in java which can take a datastructure and draws the tree for us ?

Or if I want to start from scratch, then wht should be my appraoch, becoz I am not a UI guy. And I have a little bit knowledge abt java swings

Hoping for replies
Thanks
- Vikas DK
 
Sam Codean
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey i could not get what you require? You want a Tree but not a JTree, You want to use Swing but not JTree. You want n children, and each children can have n children (that is what JTree also can do) but still you do not want to use JTree?
Is there some grudge against JTree?
 
Vikas Kulkarni
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Thanks for replying.

Actually I am not saying that I want to use Swing, but I dont to draw a Tree using anything in JAVA, but I dont want the tree to be like folder structure (directory structure) that JTree does.

So its not that I want to use Swing but anything like AWT/Applet which helps me draw a tree.

I hope u have understood my problem

Thanks
- Vikas DK
 
Vikas Kulkarni
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Correction in my reply

Actually I am not saying that I want to use Swing, I WANT to draw a Tree using anything (AWT/Swing etc) in JAVA, but I DONT want the tree to be like folder structure (directory structure) that JTree does.

So its not that I want to use Swing but anything like AWT/Applet which helps me draw a tree.

I hope u have understood my problem

Thanks
- Vikas DK
 
Sam Codean
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well still not very clear on the requirement. i guess you need to get rid of those Folder and File Icons. If that is the case then definitely there are solutions. YOu can set your own Custom Icon in the Default Tool Kit.
If you are "creating" your own JTree then i do not think that i can help.
If it is just the Look that you do not like then there are alternatives.
On a personal note i would suggest using JTree itself as it is very powerful. You only need to customize it to your needs
Hope that helps!!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!