I have a long String
that I want to display in a JTextField
. If the String
is too long, it is showing the right-portion of the String
, rather than the left portion, even when I use setHorizontalAlignment(JTextField.LEFT)
For example, if my String
is "JTextField example , this text is too long", it should show as...
|----------------------|
| JTextField example ..|
|----------------------|
but instead it shows as...
|----------------------|
| this text is too long|
|----------------------|
Could someone please suggest how this can be fixed.