In the editor, select your panel and in the properties panel, clic on the "..." button of border field. Select "Empty border" and change "insets" by clicking again on the "...".
I used often "Compound border" for making insets in a component with border. It's like the previous method but with two borders to define and select empty border for the outside border.
But if you making a game with complex animation, maybe using Swing's component is not a good idea.