Topic: [求助]关于剪切板Clipboard

  Print this page

1.[求助]关于剪切板Clipboard Copy to clipboard
Posted by: scwfeng
Posted on: 2006-04-26 18:54

Transferable contents=clipboard.getContents(this);
DataFlavor flavor=DataFlavor.stringFlavor;
if(contents.isDataFlavorSupported(flavor))
try
{
String str=(String)contents.getTransferData(flavor);
textcalculator.setText(str);
}
catch(Exception ec){ }
以上是粘贴的代码,我希望把其他文本文件中复制的内容粘贴到Java文件中,使用以上代码好像不行,请大侠指点!


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923