Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to paste image through system clipboard

843807Oct 28 2001 — edited Jan 5 2004
hi,

I must copy a image from java application to another graphic application such as photoshot. I think I must paste the image to system clipboard.
I can copy/paste a image by a clipboard made by myself(e.g. Clicpboard clipboard = new Clipboard("MyClicpboard"))). but I have no idea how to do it with system clipboard. below is the exception i can not get rid of:

java.lang.ClassCastException: [I
at sun.awt.windows.WDataTransferer.translateTransferable(WDataTransferer.java:390)
at sun.awt.DataTransferer.translateTransferable(DataTransferer.java:245)
at sun.awt.windows.WClipboard.setContents(WClipboard.java:69)
at Test.<init>(Test.java:40)
at Test.main(Test.java:12)

please give me some advise.
thanks in advance!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 2 2004
Added on Oct 28 2001
7 comments
417 views