The java.awt.TextArea has the ability to do line wrapping. This was controlled by the horizontal scrolling policy. Since scrolling is not done by JTextArea directly, backward compatibility must be provided another way. JTextArea has a bound property for line wrapping that controls whether or not it will wrap lines. By default, the line wrapping property is set to false (not wrapped).
Take a look through that Javadoc page I linked to. You will see there is a method to set Line Wrap to true. I won't tell you the name of it, but it is there. Generally when you want to set a property on something 99% of the time the name of the method is setPropertyName. And you want to set the Line Wrap property.
p.s. The reason I'm not exactly telling you the name is not to be mean or anything. Rather to help you learn how to read the Javadoc for a class. It's an essential skill to learn. If you have problems finding it, let us know and we can help further.
posted 9 years ago
Thank you Mark .
I found the setLineWrap property. I'll try next time to search more before posting a question.