Resonances in a box