code: public static void copyToClipboard(String text) {
  		final StringSelection stringSelection = new StringSelection(text);
  		final Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
  		clipboard.setContents(stringSelection, stringSelection);
  	}
docs: Copy to clipboard.
  
  @param text the text