RFR: 8180276: JTextPane getText return extra when mixed with methods of Document [v3]
Tejesh R
duke at openjdk.java.net
Fri Apr 8 12:02:42 UTC 2022
On Fri, 8 Apr 2022 11:56:36 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:
>>> But should /r/r/n cause 2 line feeds? /r should be just carriage return to cause caret to move from last column to first, why it is inserting new line?
>>
>> \r is converted to \n in setText method....... To be specific, in `read(Reader in, Document doc, int pos)` method of DefaultEditorKit class......
>
> So, that means presently it is writing /n/r/n not /r/r/n, right?
Initially it is /r/r/n from `getText()` of pane0, later it is /n/r/n from `setText()`....
-------------
PR: https://git.openjdk.java.net/jdk/pull/8122
More information about the client-libs-dev
mailing list