Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

copy to clipboard java

import java.awt.datatransfer.StringSelection;
import java.awt.Toolkit;
import java.awt.datatransfer.Clipboard;


String myString = "This text will be copied into clipboard";
StringSelection stringSelection = new StringSelection(myString);
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
clipboard.setContents(stringSelection, null);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #copy #clipboard #java
ADD COMMENT
Topic
Name
1+1 =