Here you can find the source of setClipboardImage(final Image image)
public static void setClipboardImage(final Image image)
//package com.java2s; //License from project: Apache License import java.awt.Image; import java.awt.Toolkit; import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.StringSelection; import java.awt.datatransfer.Transferable; import java.awt.datatransfer.UnsupportedFlavorException; import java.io.IOException; public class Main { public static void setClipboardImage(final Image image) { Transferable trans = new Transferable() { public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException { if (isDataFlavorSupported(flavor)) { return image; }//from ww w .j ava 2 s.c om throw new UnsupportedFlavorException(flavor); } public DataFlavor[] getTransferDataFlavors() { return new DataFlavor[] { DataFlavor.imageFlavor }; } public boolean isDataFlavorSupported(DataFlavor flavor) { return DataFlavor.imageFlavor.equals(flavor); } }; Toolkit.getDefaultToolkit().getSystemClipboard().setContents(trans, null); } public static void setClipboardImage(String content) { Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(content), null); } }