center justify jlabel

Solutions on MaxInterview for center justify jlabel by the best coders in the world

showing results for - "center justify jlabel"
Martín
29 Jan 2020
1import javax.swing.SwingConstants;
2import javax.swing.JLabel;
3
4Jlabel label1 = new Jlabel("Test");
5label1.setHorizontalAlignment(SwingConstants.CENTER);
6//Can also use SwingConstants.LEFT & .RIGHT