How to detach n number of objects?

i had a made an firing game in which the bullets have to detached they become stationary how to do this??
eg:- rootNode.attachChild(bullet);
//on each call of a button click it gets attached and we need to remove it after they become static.

This will teach you that (except the stationary detection):
http://wiki.jmonkeyengine.org/doku.php/jme3:beginner:hello_node

Stationary tracking:
http://wiki.jmonkeyengine.org/doku.php/jme3:beginner:hello_collision

u mean 2 say that i make a parent node in which many bullets are attached then i detach them!

I think you’d be better off having a pool of bullets and instead of detaching them, making them not be rendered until you need them again (facecull.frontAndBack or something).

Just keep track of your bullets… You’re thinking backwards, don’t expect the library to do things your software is supposed to do.

i didnt get u!!

The answer to your actual question is (note this is pseudo code)

 if(!bullet.physicsControl.isActive()){
  rootNode.detachChild(bullet);
  physicsSpace.remove(bullet);
 }

But your question probably more aims at getting info on how to actually get “bullet” in some part of your code. You seem to expect the library (that is jME) to do that in a way like rootNode.getAllBullets() but that is something that YOUR code has to provide. So simply keep a list of all bullets you add to the scene.

And by the way - to simulate bullets don’t use physical objects and actual spatials - just don’t.