public synchronized void setContents(Transferable contents,
ClipboardOwner owner) {
// 4378007 : Toolkit.getSystemClipboard().setContents(null, null)
// should throw NPE
if (contents == null) {
throw new NullPointerException("contents");
}
initContext();
final ClipboardOwner oldOwner = this.owner;
final Transferable oldContents = this.contents;
try {
this.owner = owner;
this.contents = new TransferableProxy(contents, true);
setContentsNative(contents);
} finally {
if (oldOwner != null && oldOwner != owner) {
EventQueue.invokeLater(new Runnable() {
public void run() {
oldOwner.lostOwnership(SunClipboard.this, oldContents);
}
});
}
}
}
SunClipboard.java 文件源码
java
阅读 23
收藏 0
点赞 0
评论 0
项目:jdk8u-jdk
作者:
评论列表
文章目录