You're currently telling Java to place the button in the center of your BorderLayout
. Java then thinks that you want the entire area filled with this button. If you want to place a normal sized button in the center of your BorderLayout
, add the button to a new JPanel
and place the JPanel
inside BorderLayout.CENTER
.
Doing this, you're telling Java to fill out BorderLayout.CENTER
with your JPanel
. The elements that you place inside this JPanel will appear normal, because these elements are not getting "stretched" because of your BorderLayout
- the JPanel
is.