Win a copy of Getting started with Java programming language this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Tree  RSS feed

 
Gizzmo Zeuzere
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello !
I must make a tree but not a binary tree. I want that a node could have many nodes (more than 2)
Does anyone have an idea ? (with a javabean)
Stephane
[ November 17, 2003: Message edited by: Gizzmo Zeuzere ]
 
Joe Ess
Bartender
Posts: 9400
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
javax.swing.tree.DefaultTreeModel uses javax.swing.tree.TreeNode instances (see javax.swing.tree.DefaultMutableTreeNode) to create a tree whose nodes may have many children. DefaultMutableTreeNode also accepts an Object to contain whatever you wish to store in your tree. Sounds like it will fit the bill.
 
Gizzmo Zeuzere
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank u ! I test it !
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!