开发者

how to copy image and text to clipboard using Java?

开发者 https://www.devze.com 2023-03-07 11:54 出处:网络
i want to copy image and text together to clipboard at same time but i can copy image or text //class to copy text

i want to copy image and text together to clipboard at same time but i can copy image or text

//class to copy text
    StringSelection selection=new StringSelection(text);

 c.setContents(selection, null);
//class to copy image
                   ImageTransferable s=new ImageTransferable(image);


                   开发者_Python百科    c.setContents(s, null);


You'll need to use a custom Transferable object:

http://www.coderanch.com/t/345580/GUI/java/Cut-copying-pasting-custom-object

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号