[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 339
  • Last Modified:

Display all nodes in a branchgroup

How Do I display the list of nodes and their properties that are in a branchgroup
0
javacrawfish
Asked:
javacrawfish
  • 4
  • 3
1 Solution
 
objectsCommented:
Enumeration i = branchgroup.getAllChildren();
while (i.hasNextElement())
{
   Node n = (Node) i.nextElement();
   // display as required
}
0
 
javacrawfishAuthor Commented:
Getting:

PickTest.java:406: cannot resolve symbol
symbol  : method hasNextElement ()
location: interface java.util.Enumeration
        while (i.hasNextElement())
                ^
1 error
0
 
objectsCommented:
sorry that should have been

while (i.hasMoreElements())
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
javacrawfishAuthor Commented:
Do you know how to set a name to a node (i.e. Box1, Box2, Cone1, .et ) so when I search thur the nodes I get the name?
0
 
objectsCommented:
you could user the user data attribute
0
 
javacrawfishAuthor Commented:

What I trying to do is let a user add images,text, etc  to a java3d world and then list the objects in the complete universe by a user provided name.

So what would be the statement to assign the "user data attribute" to, I assume I could read this info for the enumration.

Shape3D textObject = new Text2D("Rotating Yellow Text",new Color3f(1f, 1f, 0f),"Serif",60,Font.BOLD);
pbjTrans.addChild(textObject);


Thanks for the extra help.
0
 
objectsCommented:
node.setUserData(nodename);
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now