code: private static void attachGrid(Vector3f pos, float size, ColorRGBA color,
              AssetManager assetManager, Node rootNode) {
          Geometry g = new Geometry("wireframe grid", new Grid((int) size, (int) size, 1f));
          Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
          mat.getAdditionalRenderState().setWireframe(true);
          mat.setColor("Color", color);
          g.setMaterial(mat);
          g.center().move(pos);
          rootNode.attachChild(g);
      }
docs: code based on http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:debugging