Use the Clipboard
class to:
Copy a text string into the system clipboard:
copyToClipboard("Enter text to copy here");
If you use null
as the parameter, the method
clears the system clipboard of text content.
Retrieve the text contents of the system clipboard:
String clipboardContents = copyFromClipboard();
If the system clipboard does not contain any text, the method
returns an empty string (""
).
Note: Series
40 devices do not support the copyFromClipboard
method.
You can copy a text string into the system clipboard in a MIDlet and retrieve it from the clipboard in another application, and vice versa.
The Clipboard
class is supported since Series
40 6th Edition FP 1 and Java Runtime 2.1
for Symbian.