Click to See Complete Forum and Search --> : Copying to the Clipboard


Erbeere
May 10th, 2000, 01:34 AM
Hi

Is it possible to look with Java if there is something in the Clipboard of my Desktop (Windows) ? If, how and how can I put something to it by miself with Java ?

Thanks for helping

Thomas

got to my homepage at http://www.Erbeere.de

kib63613
May 10th, 2000, 03:47 AM
You may consider the class Clipboard. You may also consider the following method to get the
system clipboard, which might be the possible method for you to get the native process's clipboard
data.
Toolkit.getDefaultToolkit().getSystemClipboard().
In the class Clipboard, you may use the getContent() method to retrieve the current data in the clipboard.
You may also reference the interface Transferable.
I seldom involve this topic, java.awt.datatransfer, so it is for suggestion. You may also reference the
chapter 16 of Java AWT Reference by John Zukowski.
good luck,
Alfred Wu