Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > clipboard.setContents destroys clipboard.getContents?

Reply
Thread Tools

clipboard.setContents destroys clipboard.getContents?

 
 
spunibard@gmail.com
Guest
Posts: n/a
 
      03-01-2007
when i'm using clipboard.setContents to reset clipboard information it
is breaking clipboard.getContents. (getContents will return whatever
setContents set regardless of the outside program putting information
on the clipboard. this was not a problem until setContents was added.
am i doing or expecting something wrong?

java.awt.datatransfer.StringSelection ss = new
java.awt.datatransfer.StringSelection(s);
this.clipboard.setContents(ss, ss);

(...)

this.clipboardTransferable = this.clipboard.getContents(null);
try {
return
this.clipboardTransferable.getTransferData(java.aw t.datatransfer.DataFlavor.stringFlavor).toString() ;
}

 
Reply With Quote
 
 
 
 
Andrew Thompson
Guest
Posts: n/a
 
      03-02-2007
On Mar 2, 8:16 am, (E-Mail Removed) wrote:
> when i'm using clipboard.setContents to reset clipboard information it
> is breaking clipboard.getContents. (getContents will return whatever
> setContents set regardless of the outside program putting information
> on the clipboard. this was not a problem until setContents was added.
> am i doing or expecting something wrong?


I would need to see an SSCCE* to determine if
what you say (and the code) makes any sense.
* <http://www.physci.org/codes/sscce.html>

Andrew T.

 
Reply With Quote
 
 
 
 
spunibard@gmail.com
Guest
Posts: n/a
 
      03-02-2007

Thanks Andrew, you helped me figure this out- After writing an SSCCE i
found that my problem seemed to be outside of where i was looking.
(SSCCE worked great) eventually i found (i think) that because the
process wasn't running in it's own thread, it seemed to be getting in
the way of itself when it came to the clipboard owner changing. which
is odd (to me) because as long as the ownership of the clipboard
didn't switch to my program, the clipboard stayed current just fine.


On Mar 1, 11:54 pm, "Andrew Thompson" <(E-Mail Removed)> wrote:
>
> I would need to see an SSCCE* to determine if
> what you say (and the code) makes any sense.
> * <http://www.physci.org/codes/sscce.html>
>
> Andrew T.



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
aspnet_regiis.exe -ir -enable destroys perf counters? Stefan Kuhr ASP .Net 2 11-21-2006 08:33 AM
Programmatic OleDB access destroys current Session daver@csh.rit.edu ASP .Net 6 06-30-2005 10:12 AM
Floppy drive destroys disks Kevin Computer Support 4 12-22-2004 04:32 AM
Firefox Destroys my Computer margon21@hotmail.com Firefox 8 11-14-2004 10:42 PM
Install of SP1 to WinXP Pro destroys dual boot function of Win98/WinXPsystem Richard Owlett Computer Support 5 07-27-2004 07:49 AM



Advertisments