How can I force the text go to the button of the panel?
Posted
by Roman
on Stack Overflow
See other posts from Stack Overflow
or by Roman
Published on 2010-03-30T15:27:49Z
Indexed on
2010/03/30
15:33 UTC
Read the original article
Hit count: 202
At the moment I have the following code which works fine.
label = new JLabel(panelLabel,SwingConstants.CENTER);
outputPanel.add(label,BorderLayout.CENTER);
I get the text in the center of the panel (in terms of the left-right position as well as in terms of the top-bottom).
Now I want to set the position to the bottom (and center in terms of "left-right"). I tried to use SOUTH instead of the CENTER in the first line. Compiler does not complains but during the execution i get IllegalArgumentException: HorizontalAlignment
. What is that?
© Stack Overflow or respective owner