Java Example Program/ Sample Source Code
import java.awt.Toolkit;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.DataFlavor;
public class GetName_Clipboard{
public static void main(String[] argv) throws Exception {
DataFlavor dataFlavor = new DataFlavor("text/plain; charset=ASCII", "Plain ASCII text");
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
Object data = clipboard.getData(dataFlavor);
System.out.println("isDataFlavorAvailable "+data);
System.out.println("getName "+clipboard.getName());
}
} |
|
|