April 1997
Intermediate to advanced
1074 pages
22h 46m
English
The Clipboard class is a repository for a Transferable object and can be used for cut, copy, and paste operations. The system clipboard can be accessed by calling Toolkit.getDefaultToolkit().getSystemClipboard(). You can use this technique if you are interested in exchanging data between your application and other applications (Java or non-Java) running on the system. In addition, Clipboard can be instantiated directly, if “private” clipboards are needed.
public class java.awt.datatransfer.Clipboard
extends java.lang.Object {
// Variables
protected Transferable contents;
protected ClipboardOwner owner;
// Constructors
public Clipboard (String name);
// Instance Methods
public synchronized Transferable getContents (Object requestor);
public String getName();
public synchronized void setContents (Transferable contents, ClipboardOwner owner);
}
protected Transferable contents
The object that the Clipboard contains, i.e., the object that has been cut or copied.
protected ClipboardOwner owner
The object that owns the contents. When something else is placed on the clipboard, owner is notified via lostOwnership().
public Clipboard (String name)
| Parameters | name | The name for this Clipboard. |
| Description | Constructs a Clipboard object with the given name ... | |
Read now
Unlock full access