Your sample code is not very clear (i think) as you
define " scene = new BranchGroup() " and then set it's
capabilities; however you the declare " scene =
createSceneGraph(vis) " which is calling another
initialization method - unless you are also the
setting the capabilities as well within the
createSceneGraph(vis) method: you would get the
exception error.

Also bear in mind that if you create a branchgroup and
then detach it from the scene and then re-initialize
it you must also reset it capablities.

--- "Brobbey,Isaac (neuron)"
<[EMAIL PROTECTED]> wrote:
>  Dear all:
>
> i have a little trouble reading all the Children
> from a branch group which i
> created as follows:
>
> private BranchGroup scene = new BranchGroup();
>
>
>
scene.setCapability(BranchGroup.ALLOW_CHILDREN_READ);
>
>
scene.setCapability(BranchGroup.ALLOW_CHILDREN_WRITE);
>
>
scene.setCapability(BranchGroup.ALLOW_CHILDREN_EXTEND);
>
> scene = createSceneGraph(vis);
> System.out.println("all
> children="+scene.numChildren());
>
> java.util.Enumeration enumChild =
> scene.getAllChildren();
>
> when i run the code i get an error like
>
> all children=3
> javax.media.j3d.CapabilityNotSetException: Group: no
> capability to read
> children
>
>         at
> javax.media.j3d.Group.getAllChildren(Group.java:236)
>         at
>
GraphicDisplay.showChildren(GraphicDisplay.java:1098)
>         at
>
GraphicDisplay.actionPerformed(GraphicDisplay.java:822)
>         at
>
javax.swing.AbstractButton.fireActionPerformed(Unknown
> Source)
>         at
>
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknow
> n Source)
>
> the same capability is set for each of the three
> children.I dont know of a
> diffrent way of reading the children. i may be
> running out of Ideas , so any
> help will be appreciated,
>
> thanks,
>
> Isaac
>
>
===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED]
> and include in the body
> of the message "signoff JAVA3D-INTEREST".  For
> general help, send email to
> [EMAIL PROTECTED] and include in the body of the
> message "help".


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to