The text is horizontally and vertically centered
import javax.swing.JLabel; public class Main { public static void main(String[] argv) throws Exception { JLabel label = new JLabel("Text Label", JLabel.CENTER); } }