[Solved] Newline character \n treated as paragraph break
Posted: Thu Sep 18, 2008 2:06 am
Hello,
I'm trying to insert a JTextPane into OOo Writer from Java, and everyone seems to be going well except that "\n" in Java are treated as hard carriage returns or paragraph breaks when the JTextPane is inserted into a OOo Writer document. This leaves an extra space between the lines which I don't want. I need a "soft" carriage return, e.g., pressing shift + enter instead of just enter.
Here is a snippet of my code where txtDetails is a JTextPane:
xParagraphCursor.setString( txtDetails.getText().toString() );
If anybody has any information on this, I would greatly appreciate it.
Thanks,
Jeff
I'm trying to insert a JTextPane into OOo Writer from Java, and everyone seems to be going well except that "\n" in Java are treated as hard carriage returns or paragraph breaks when the JTextPane is inserted into a OOo Writer document. This leaves an extra space between the lines which I don't want. I need a "soft" carriage return, e.g., pressing shift + enter instead of just enter.
Here is a snippet of my code where txtDetails is a JTextPane:
xParagraphCursor.setString( txtDetails.getText().toString() );
If anybody has any information on this, I would greatly appreciate it.
Thanks,
Jeff