Answers for "set label alignment swing"

2

center justify jlabel

import javax.swing.SwingConstants;
import javax.swing.JLabel;

Jlabel label1 = new Jlabel("Test");
label1.setHorizontalAlignment(SwingConstants.CENTER);
//Can also use SwingConstants.LEFT & .RIGHT
Posted by: Guest on October-03-2020
0

horizontalAlignment center jlabel

JLabel lab=new JLabel("text");
lab.setHorizontalAlignment(SwingConstants.LEFT);
Posted by: Guest on November-22-2020

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language