Placing Text on the System Clipboard StringSelection ss = new StringSelection("aString"); // The following 2 lines of code must be // on the same line Toolkit.getDefaultToolkit().getSystemClipboard(). setContents(ss, null);