下面是JavaDoc文档的解释:
JLabel
public JLabel(String text,int horizontalAlignment)Creates a JLabel instance with the specified text and horizontal alignment. The label is centered vertically in its display area. Parameters:
text - The text to be displayed by the label.
horizontalAlignment - One of the following constants defined in SwingConstants: LEFT, CENTER, RIGHT, LEADING or TRAILING.------注意了只能是这些SwingConstants常量
JLabel
public JLabel(String text,int horizontalAlignment)Creates a JLabel instance with the specified text and horizontal alignment. The label is centered vertically in its display area. Parameters:
text - The text to be displayed by the label.
horizontalAlignment - One of the following constants defined in SwingConstants: LEFT, CENTER, RIGHT, LEADING or TRAILING.------注意了只能是这些SwingConstants常量
再问一下LEADING ,是从左到右 和从右到左 的语言的开始。是不是就是说,如果该语言是从左到右的,那么LEADING = LEFT ,要是从右到左的,那么LEADING = RIGHT。是这样的吗?TRAILING同上。
tomcatjava(小鱼儿),我再开个贴,你进来接分哈。