RFR: 8180276: JTextPane getText return extra when mixed with methods of Document [v5]

Alexey Ivanov aivanov at openjdk.java.net
Fri Apr 15 14:35:56 UTC 2022


On Fri, 15 Apr 2022 01:18:58 GMT, Phil Race <prr at openjdk.org> wrote:

> but what happens if a user pastes
> a few lines of text from windows Notepad - and it contains \r\n ?

This is handled: The text is converted by `PasteAction` somehow, the model contains only `\n` as the result.

If it weren't handled, there would be bug reports about this.

`JTextField` filters out all line breaks on clipboard, they're replaced with spaces on paste.

-------------

PR: https://git.openjdk.java.net/jdk/pull/8122



More information about the client-libs-dev mailing list