text center jlabel code example Example: jlabel text center JLabel label = new JLabel("The Label", SwingConstants.CENTER);