how to set jlabel text in center code example
Example 1: how to set jlabel in center
jLabelvariable.setLocation((this.getWidth()-jLabelvariable.getWidth())/2,50);
Example 2: horizontalAlignment center jlabel
JLabel lab=new JLabel("text");
lab.setHorizontalAlignment(SwingConstants.LEFT);