This is a play on words. The word "painfully" means physically unconfortable due to swallowing glass. However a "pane" is part of a window implying that Tom is speaking "panefully" due to having swallowed a window pane.
' ' I swallowed some of the glass from that broken window , ' ' Tom said painfully .