> Actually, Swing text components use "\n" to separate lines. When you
> use the built-in methods to paste text into the JTextArea or to read
> text in from a file, the line separators get converted.
ahaa, thanks very much. I suppose I could write my own code to
paste the contents of the text component into clipboard using platform
specific line-endings and invoke it using a button instead of ctl-c.
Sound feasible? Or is there an obviously easier solution?
Steve W. Jackson - 14 Jun 2004 20:51 GMT
>:Alan Moore <jbigboote@yoyodyne.com> wrote in message
>:news:<qagqc0li96c875cdotukqiguptu425oiu8@4ax.com>...
[quoted text clipped - 7 lines]
>:
>:Sound feasible? Or is there an obviously easier solution?
I think you should be able to use the copy() method inherited from
JTextComponent, shouldn't you? The API says it transfers the currently
selected range to the system clipboard. JTextArea, JTextPane and
JEditorPane all inherit from that common abstract class.
= Steve =

Signature
Steve W. Jackson
Montgomery, Alabama
Alan Moore - 15 Jun 2004 07:33 GMT
>> Actually, Swing text components use "\n" to separate lines. When you
>> use the built-in methods to paste text into the JTextArea or to read
[quoted text clipped - 5 lines]
>
>Sound feasible? Or is there an obviously easier solution?
I think that would be the easiest way. I once looked into the
possibility of overriding the existing behavior, but gave up after
taking over an hour just to *find* the relevant code. Adding your own
action should be much less painful.