wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes Paste inserts 2 copies of clipboard Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Paste inserts 2 copies of clipboard" Watch "Paste inserts 2 copies of clipboard" New topic
Author

Paste inserts 2 copies of clipboard

David A. Smith
Greenhorn

Joined: Sep 08, 2010
Posts: 9

Hi all,

I have a text field that I want to support the ^C and ^V conventions for copy and paste. The problem is that I get *two* copies of whatever was in the clipboard. The code is so simple that I would think there's not much to go wrong. But clearly I'm wrong... Anyway, the JVM is 1.6.0_18 on a Linux box.

Here's the code:



Thanks,

Dave.
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4530
    
    5

The copy,cut,selectAll and paste actions are already supported via key bindings. In reinventing the wheel, you've ended up with a bicycle.
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2177
    
    7
Darryl Burke wrote:In reinventing the wheel, you've ended up with a bicycle.


I like that
David A. Smith
Greenhorn

Joined: Sep 08, 2010
Posts: 9

Okay, thanks...? I'll have to try on different versions/platforms. I'm getting inconsistent behaviors and reports from some users that it doesn't work. (Perhaps an older JDK behaves differently...) Still, thanks for the (humorous!) reply.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Paste inserts 2 copies of clipboard