Class Clipboard


public final class Clipboard
extends Object

Provides a global clipboard for cut and paste operations.

Method Summary
 Object get()
          Retrieves the clipboard's current contents.
static Clipboard getClipboard()
          Retrieves the system's clipboard object.
 Object put(Object o)
          Copies an object to the clipboard.
 String toString()
          Retrieves string equivalent of clipboard's contents.
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

Method Detail


public static Clipboard getClipboard()
Retrieves the system's clipboard object.

System clipboard.


public Object get()
Retrieves the clipboard's current contents.

Notice that this get is not destructive: the clipboard remains loaded with this object until a new one gets put to replace it.

Current object on the clipboard.


public Object put(Object o)
Copies an object to the clipboard.

This operation replaces the existing object with your new one. Accordingly, you can clear out the clipboard by passing null into this method.

Note: This method throws a SecurityException if third-party applications provide an object other than a String or StringBuffer as parameter to this method.

o - New object to put on the clipboard.
Previous contents of the clipboard.
JDE 4.0.2


public String toString()
Retrieves string equivalent of clipboard's contents.

This method invokes toString() on the clipboard's current contained object. If the contents are null, then an empty string is returned.

toString in class Object
String representation of the clipboard's current contents.

Copyright 1999-2004 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.