Search code examples
javaswingjtextarea

JTextArea and long text format


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?


Solution

  • Check out...

    And you might find How to use Text Areas useful.