3
There is how to capture the Clipboard in Windows environment with Java?
I can capture the screen, but I would like to capture the Clipboard (that’s what stays in memory when doing CTRL+C, for example).
A simple tip is enough for me.
3
There is how to capture the Clipboard in Windows environment with Java?
I can capture the screen, but I would like to capture the Clipboard (that’s what stays in memory when doing CTRL+C, for example).
A simple tip is enough for me.
5
Yeah, you can use the class Toolkit. Here’s an example:
import java.awt.HeadlessException;
import java.awt.Toolkit;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.UnsupportedFlavorException;
import java.io.IOException;
String data = (String) Toolkit.getDefaultToolkit()
.getSystemClipboard().getData(DataFlavor.stringFlavor);
The method getData()
and the stringFlavor
return plain text from Clipboard.
More information:
Browser other questions tagged java clipboard
You are not signed in. Login or sign up in order to post.
Thanks, I’ll give it a study and anything I ask.
– Vernon