The problem is not with JLabel itself, but with the layout management you use. Because when there is only one object, JLabel, the difference cannot be seen. When you put JLabel and other objects together, the blank space in the middle will appear.
You can take a look at the tutorial here to learn: http://zetcode.com/tutorials/javaswingtutorial/swinglayoutmanagement/
The problem is not with JLabel itself, but with the layout management you use. Because when there is only one object, JLabel, the difference cannot be seen. When you put JLabel and other objects together, the blank space in the middle will appear.
You can take a look at the tutorial here to learn: http://zetcode.com/tutorials/javaswingtutorial/swinglayoutmanagement/