This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
hi, do you mean horizontal scrolling? I suppose so, as JTextField has only one row. what exactly do you mean by automatic? That the cursor (if any) is always visible, and the user can scroll by hitting the arrow left and right keys? that should work. you can influence the initial placement of the text by either setting the horizontal alignment or placing the cursor (in the Document) explicitely, for what I remember. Chantal
JTextArea does not automatic scrolling, so you have to extend it with your own class that does this. This is easy to do by adding a DocumentListener that sets the caret position to the end of the text when the document's content changes.