当前页面:
在线文档首页 >
JDK 5 Documentation v1.2.2, Java 2 SDK 英文文档
Java(TM) 2 Platform, Standard Edition, v1.2.2 API Specification: Class Clipboard - JDK 5 Documentation v1.2.2, Java 2 SDK 英文文档
java.awt.datatransfer
Class Clipboard
java.lang.Object
|
+--java.awt.datatransfer.Clipboard
- public class Clipboard
- extends Object
A class which implements a mechanism to transfer data using
cut/copy/paste operations.
Method Summary |
Transferable |
getContents(Object requestor)
Returns a transferable object representing the current contents
of the clipboard. |
String |
getName()
Returns the name of this clipboard object. |
void |
setContents(Transferable contents,
ClipboardOwner owner)
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. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
owner
protected ClipboardOwner owner
contents
protected Transferable contents
Clipboard
public Clipboard(String name)
- Creates a clipboard object.
getName
public String getName()
- Returns the name of this clipboard object.
setContents
public void setContents(Transferable contents,
ClipboardOwner owner)
- 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
registered, that owner is notified that it no longer holds ownership
of the clipboard contents.
- Parameters:
content
- the transferable object representing the clipboard contentowner
- the object which owns the clipboard content
getContents
public Transferable getContents(Object requestor)
- Returns a transferable object representing the current contents
of the clipboard. If the clipboard currently has no contents,
it returns null. The parameter Object requestor is not currently used.
- Parameters:
requestor
- the object requesting the clip data (not used)- Returns:
- the current transferable object on the clipboard
Submit a bug or feature
Java, Java 2D, and JDBC are a trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1999 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.