aspose file tools
The moose likes Beginning Java and the fly likes node with more than 3 leaf Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "node with more than 3 leaf" Watch "node with more than 3 leaf" New topic
Author

node with more than 3 leaf

sudharshiya mohan
Greenhorn

Joined: Dec 30, 2005
Posts: 8
i want i create a node with 4 or more leaf as shown below
O ---------O
/ \ / \ / \ / \
O O O O O O O O
anyone help me please


with regards<br />sudhar
Jesper de Jong
Java Cowboy
Bartender

Joined: Aug 16, 2005
Posts: 12928
    
    3

Sorry, but your question is much too vague. What kind of node do you want to create? Are you writing your own classes to represent a tree structure? Do you understand how to create a node with 3 or less leaves? So why is creating a node with more than 3 leaves difficult? What does your source code look like?


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
karl koch
Ranch Hand

Joined: May 25, 2001
Posts: 388
sounds like you want to build a tree ?
the parent needs to have a datastructure that holds all the child nodes (e.g. a Set)
then in your (parent) node you need a method like addChild(SomeObject obj) which adds the object to the datastructure.
also you will need methods to retrieve the childreen and so on...

k
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: node with more than 3 leaf
 
Similar Threads
JTree and indent
Expanding a Specific Node in JTree
how can I change this tree with different Icons for Different nodes at Run Time
JTree reduce indent for leaf node
JTree Leaf Node Folder