Marcel

> Why the  instruction at Test.createCanvasPanel(Test.java:52), 
> generate a =
> RestrictedAccessException
>  (javax.media.j3d.RestrictedAccessException: Group: only a 
> BranchGroup =
> node may be added ),
>  if the variable component is a BranchGroup ?

>  component.addChild(new Sphere (0.1f, new Appearance()));

Certainly "component" is a BranchGroup, but what the exception says is that the Node 
you're adding has to be a BranchGroup, and not the Group to which you're adding it.

If you do it like below, it should work (Don't forget of setting proper capability 
bits in "component":

BranchGroup bg = new BranchGroup();
bg.addChild(new Sphere (0.1f, new Appearance()));
component.addChild(bg);

>  Why the first =
> addChild(Sphere) don't generate this exception ?

It doesn't generate the exception because at the time it is called the scene graph 
still isn't live. 


                HTH

                        Fabio

==========================================================================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