I want to set the user's clipboard to a string in a Java console application. Any ideas?
I want to set the user's clipboard to a string in a Java console application. Any ideas?
For anyone still stumbling upon this post searching for the JavaFX way to accomplish this, here you go:
ClipboardContent content = new ClipboardContent();
content.putString("Some text");
content.putHtml("<b>Bold</b> text");
Clipboard.getSystemClipboard().setContent(content);
For further information, read the documentation.