Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #30539
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Martin Gregorie <martin@address-in-sig.invalid> |
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: JEditorPane question |
| Date | Thu, 11 Dec 2014 18:31:47 +0000 (UTC) |
| Organization | A noiseless patient Spider |
| Lines | 29 |
| Message-ID | <m6cnui$3tg$1@dont-email.me> (permalink) |
| References | <m64a5v$d3j$1@dont-email.me> <m659sr$5vl$1@dont-email.me> <m65car$d52$1@dont-email.me> <m65sr8$tdq$1@dont-email.me> <m65trp$l8$1@dont-email.me> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8 |
| Content-Transfer-Encoding | 8bit |
| Injection-Date | Thu, 11 Dec 2014 18:31:47 +0000 (UTC) |
| Injection-Info | mx02.eternal-september.org; posting-host="e5160e2be48f1ea550cf61512446f525"; logging-data="4016"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/wVDeUwbtRG3438lkkVHm8tDiy4YkcDY4=" |
| User-Agent | Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2) |
| Cancel-Lock | sha1:l0dCKhhqLhHtgChMEzmxI34QFFw= |
| Xref | csiph.com comp.lang.java.programmer:30539 |
Show key headers only | View raw
On Mon, 08 Dec 2014 23:28:59 -0500, Jeff Higgins wrote:
> should be:
> source.getText().substring(p0.getOffset(), p1.getOffset());
>
Thanks for the tutorial in using the TransferHandler class and for the
correction shown above, but cut and paste still doesn't seem to be
getting CRLF: without that correction cut and paste seems to be
duplicating LF, i.e. the double newline in the middle of your examole
test becomes LFLFLFLF and with the correction I'm seeing LFLF. In both
cases the text, when grabbed with getText() and sent to System.out or
written to a file via the PrintWriter, shows CRLFCRLF.
So, it looks very much as though copying and pasting text with CRLF isn't
going to be at all easy. I tried adding String.replace() into the last
line of CreateTransferrable():
return new StringSelection(data.replace("\n", "\r\n"));
but that merely doubled the number of "\n" symbols output, so I think the
way to go will be to modify the website to accept both Linux and Windows
linebreaks.
Thanks for your help: I've learnt quite a lot about this part of Swing.
--
martin@ | Martin Gregorie
gregorie. | Essex, UK
org |
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
JEditorPane question Martin Gregorie <martin@address-in-sig.invalid> - 2014-12-08 13:47 +0000
Re: JEditorPane question Jeff Higgins <jeff@invalid.invalid> - 2014-12-08 17:48 -0500
Re: JEditorPane question Martin Gregorie <martin@address-in-sig.invalid> - 2014-12-08 23:30 +0000
Re: JEditorPane question Jeff Higgins <jeff@invalid.invalid> - 2014-12-08 19:14 -0500
Re: JEditorPane question Jeff Higgins <jeff@invalid.invalid> - 2014-12-08 19:49 -0500
Re: JEditorPane question Jeff Higgins <jeff@invalid.invalid> - 2014-12-08 20:48 -0500
Re: JEditorPane question Jeff Higgins <jeff@invalid.invalid> - 2014-12-08 21:21 -0500
Re: JEditorPane question Jeff Higgins <jeff@invalid.invalid> - 2014-12-08 21:37 -0500
Re: JEditorPane question Jeff Higgins <jeff@invalid.invalid> - 2014-12-08 23:11 -0500
Re: JEditorPane question Jeff Higgins <jeff@invalid.invalid> - 2014-12-08 23:28 -0500
Re: JEditorPane question Martin Gregorie <martin@address-in-sig.invalid> - 2014-12-11 18:31 +0000
Re: JEditorPane question Martin Gregorie <martin@address-in-sig.invalid> - 2014-12-09 09:41 +0000
Re: JEditorPane question Jeff Higgins <jeff@invalid.invalid> - 2014-12-09 22:41 -0500
Re: JEditorPane question Jeff Higgins <jeff@invalid.invalid> - 2014-12-10 00:46 -0500
csiph-web