Java剪贴板所有者目的? [英] Java clipboardOwner Purpose?

查看:57
本文介绍了Java剪贴板所有者目的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编写了一个Java应用程序,该程序将字符串复制到系统剪贴板。构造函数使用

I wrote a Java application that copies a string to the system clipboard. The constructor uses

Clipboard.setContents(Transferable contents, ClipboardOwner owner)

http://docs.oracle.com/javase/6/docs/api/java/awt/datatransfer/Clipboard.html

我的工作正常,但是我不确定ClipboardOwner做什么?查看Java api并不能真正说明很多信息。

I got it working fine but I am not sure what the ClipboardOwner does? Looking at the Java api does not really tell much info.

http://docs.oracle.com/javase/6/docs/api/java/awt/datatransfer/ClipboardOwner.html

即使传递ClippboardOwner = null也很奇怪。所以我不确定这是什么意思?有人知道吗?

Oddly enough even passing a ClippboardOwner = null works. So I'm not exactly sure what the point of it is? Does anyone have any idea?

推荐答案

如果您的应用程序或其组件之一实现了 ClipboardOwner 接口以适当的方式显示,它可以向您显示用户已从另一个应用程序或您自己的应用程序的另一个组件向系统剪贴板复制了一些数据。
请参见以下示例

If your application, or one of it's components implements ClipboardOwner interface in appropriate way, it can show you that the user copied some data to the system clipboard from another application, or from another component of your own application. See this example.

这篇关于Java剪贴板所有者目的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆