Hi David, i would advice yout to use the following construct:
you have your static brachgroup B and you add/remove only other branchgroups from it (no other node implementations like your Axis (which is not a type i know). so rather than having B | A where A is your Axis object, i wiuld suggest you use B | b | A where b is anoher branchgroup. that way you can use the branchgroups (b) detach() method to detach the axis form the upper scene graph. Using this approach you are also available to attach/detach from a live scenegraph, which is something you want to do later, anyway. Note that you have to set the appropriate capabilities for adding/removing and detaching in the repective node elements using the setCapabiliy() method. hope this helps, cheers, Karsten BTW: it's more helpful if you attach the full stack trace when you encounter an exception! David Bourgais wrote: > Hi ! > > I've got a problem for removing a child of a BranchGroup. > I've declared as a static public objects my branchgroup and the child > which I would like to remove. > In one of my functions, I add the child (the type of the child is an > Axis()) to my BranchGroup. > In another function, with a boolean, I want to remove or to add the child. > If I want to remove, I use the method removeChild(). But, when I execute > my program, when I remove the Axis, nothing happened and there's an > error (java.lang.NullPointerException). > Anyone would help me ? > Any exemple of source code will be appreciated. > > Thanks. > > David Bourgais > > =========================================================================== > 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". =========================================================================== 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".
