Java tutorial
//package com.java2s; import java.awt.*; import java.awt.datatransfer.StringSelection; public class Main { public static void copyStringToClipboard(String string) { Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(string), null); } }