Reputation: 7995
This is probably very elementary question. I have a JTextArea, for example:
JTextArea area = new JTextArea();
I sometimes insert into this text area long pieces of text (for example using copy-paste method) - this area is for user input.
The problem is, that the text inserts only on one long line instead of adapting the the size of this component. Is there some easy way how to fix this?
Upvotes: 0
Views: 552
Reputation: 4746
Hi there is a property to be set if you want this line wrapping.
JTextArea textArea = new JTextArea();
textArea.setLineWrap(true);
Hope this helps
Upvotes: 1
Reputation: 347184
Check out...
And you might find How to use Text Areas useful.
Upvotes: 6