java.awt.datatransfer Reference

Contents:
Clipboard
ClipboardOwner
DataFlavor
StringSelection
Transferable
UnsupportedFlavorException

Clipboard

Name

Clipboard

[Graphic: Figure from the text]

Description

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.

Class Definition

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);
}

Variables

contents

protected Transferable contents

The object that the Clipboard contains, i.e., the object that has been cut or copied.

owner

protected ClipboardOwner owner

The object that owns the contents. When something else is placed on the clipboard, owner is notified via lostOwnership().

Constructors

Clipboard

public Clipboard (String name)

Instance Methods

getContents

public synchronized Transferable getContents (Object requestor)

getName

public String getName()

setContents

public synchronized void setContents (Transferable contents, ClipboardOwner owner)

See Also

ClipboardOwner, Toolkit, Transferable