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
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
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?
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.
When the next person puts something into the clipboard the owner you give to the clipboard will be told that they are no longer on the clipboard. There is only one known implementation and it is empty according to this. So it looks like a vestigial tail that is just sort of hanging out.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With