📜  居中对齐 jlabel - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:34.758000             🧑  作者: Mango

代码示例1
import javax.swing.SwingConstants;
import javax.swing.JLabel;

Jlabel label1 = new Jlabel("Test");
label1.setHorizontalAlignment(SwingConstants.CENTER);
//Can also use SwingConstants.LEFT & .RIGHT