The box with interior walls painted in black **is not** the blackbody. The realization of the surface of a black body is the surface of a small hole (small with respect to the size of the box) on the wall of such a box. 

As clearly stated in [wikipedia][1] page:

> Any light entering the hole is reflected or absorbed at the internal surfaces of the body and is unlikely to re-emerge, making the hole a nearly perfect absorber. When the radiation confined in such an enclosure is in thermal equilibrium, the radiation emitted from the hole will be as great as from any body at that equilibrium temperature. 


  [1]: https://en.wikipedia.org/wiki/Black_body