Borders
In a hierarchical layout, you might put a border around a panel to visibly group together the set of components it contains. The border can optionally include a title for the panel.
You might also put an empty border around a component, simply to create extra space around it.
You create a border using static methods of the BorderFactory class, then add it to a panel or other component using the setBorder() method of JComponent.