Put a JPanel
in the CENTER
and set the layout to GridBagLayout
or BoxLayout
as seen in this answer to Set component at center of the page.
The GridBagLayout
is used to center a label containing the yellow/red gradient image seen in the Nested Layout Example.