BorderedPanelExample -- defining a panel subclass that draws a border around itself and arranges its components (and label) safely inside that border.

The source.