...
>I want to have a text wrap feature (wordwrap)
Well for pity's sake. Did you ever consider RTFM on
this matter?
<http://java.sun.com/javase/6/docs/api/javax/swing/JTextArea.html#setWrapStyleWor
d(boolean
)>
Just as a comment, but this is not a help-desk, it is
a good idea to check the JavaDocs (carefully) before
asking for information that is otherwise clearly documented.

Signature
Andrew Thompson
http://www.physci.org/
bH - 30 Dec 2007 06:11 GMT
> ..
>
[quoted text clipped - 14 lines]
>
> Message posted via JavaKB.comhttp://www.javakb.com/Uwe/Forums.aspx/java-setup/200712/1
Continuing the idea of textwrapping
Given this code snippet, I can take a single long line
of more than 80 characters from an IDE. This does partition
the line in appearance
String str = "string";
int lenStr = str.length();
if(lenStr > 70){
String frontStr = str.substring(0,70);
String backStr = str.substring(70, lenStr);
textArea2.append(frontStr+"\r\n");
textArea2.append(backStr+"\n");
}
else
if (lenStr < 71)
{
System.out.println(str);
textArea2.append(str+"\n");
}
However, when I copy/paste the 2 broken lines back into the
IDE , and compile it, it will not read it without showing a
an error. I suppose I could use the keyboard to break the line
originally and not automate the task.
If I use the code above, I want is to make it the broken lines
act so as to read as if I edited it with the keyboard in the
first place.
Your help is appreciated.
bH