Sets the current contents of the clipboard to the specified transferable object and registers the specified clipboard owner as the owner of the new contents.
If there is an existing owner different from the argument
owner, that owner is notified that it no longer
holds ownership of the clipboard contents via an invocation
of ClipboardOwner.lostOwnership() on that owner.
An implementation of setContents() is free not
to invoke lostOwnership() directly from this method.
For example, lostOwnership() may be invoked later on
a different thread. The same applies to FlavorListeners
registered on this clipboard.
The method throws IllegalStateException if the clipboard
is currently unavailable. For example, on some platforms, the system
clipboard is unavailable while it is accessed by another application.
contents | the transferable object representing the clipboard content | |
owner | the object which owns the clipboard content |
IllegalStateException | if the clipboard is currently unavailable |
java.awt.Toolkit.getSystemClipboard
Diagram: datatransfer