Tag: clipboard

[QA] How to get clipboard strings in JAVA SWT

Clipboard clipboard = new Clipboard(Display.getDefault());
// copy to clipboard
clipboard.setContents(new String[]{"My Text in Clipboard"}, new Transfer[]{TextTransfer.getInstance()});
// paste from clipboard
String text = clipboard.getContents(TextTransfer.getInstance());
Tags : , ,