JTextField
public void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text. Valid keys are:
JTextField.LEFT
JTextField.CENTER
JTextField.RIGHT
JTextField.LEADING
JTextField.TRAILING
invalidate and repaint are called when the alignment is set, and a PropertyChange event ("horizontalAlignment") is fired.
Parameters:
alignment - the alignment
Throws:
IllegalArgumentException - if alignment is not a valid key