{"id":978,"date":"2018-09-17T19:00:31","date_gmt":"2018-09-17T10:00:31","guid":{"rendered":"https:\/\/chat-messenger.com\/?p=978"},"modified":"2018-12-23T01:50:41","modified_gmt":"2018-12-22T16:50:41","slug":"copy-clipboard","status":"publish","type":"post","link":"https:\/\/chat-messenger.com\/en\/blog\/java\/copy-clipboard","title":{"rendered":"Copy to Java Clipboard"},"content":{"rendered":"<h2 class=\"common_title\"><a name=\"0\">Java <strong>clipboard<\/strong>copy to<\/a><\/h2>\n<p>\n<strong>JavaSwing<\/strong>to a string with<strong>Copy to clipboard<\/strong>The following is a sample source that will<br \/>\n<strong>JavaSwing<\/strong>To manipulate the clipboard with<strong>Clipboard<\/strong>to be used.<br \/>\nClipboard gets it this way.\n<\/p>\n<div class=\"point\">\n<strong>Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();<\/strong>\n<\/div>\n\n<h2 class=\"common_title\"><a name=\"1\">sample program<\/a><\/h2>\n<pre class=\"sample_src\">\/**\r\n * Copy the specified string to the clipboard.\r\n * @param select string.\r\n *\/\r\npublic static void copyToClipboad(String select) {\r\n    Clipboard clipboard = Toolkit.getDefaultToolkit()\r\n            .getSystemClipboard();.\r\n    StringSelection selection = new StringSelection(select);\r\n    clipboard.setContents(selection, selection);\r\n}    \r\n<\/pre>\n<p><script type=\"text\/javascript\" src=\"https:\/\/chat-messenger.com\/js\/common.js?dd12sssas2223\" charset=\"UTF-8\"><\/script><br \/>\n<script type=\"text\/javascript\"> writePR(); <\/script><\/p>\n<h2 class=\"common_title\"><a name=\"2\">Execution Result<\/a><\/h2>\n<p>\u25c6Example of Execution<\/p>\n<pre class=\"sample_src\">public static void main(String[] args) {\r\ncopyToClipboad(\"Chat&amp;Messenger Chat and Messenger!!!\") ;\r\n}\r\n<\/pre>\n<p>\u25c6Output result<\/p>\n<pre class=\"console\">*This is the result of executing \"Paste\" in a text editor.\r\n\r\nChat&amp;Messenger Chat and Messenger!\r\n<\/pre>","protected":false},"excerpt":{"rendered":"<p>Java \u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9\u3078\u30b3\u30d4\u30fc JavaSwing\u3067\u6587\u5b57\u5217\u3092\u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9\u3078\u30b3\u30d4\u30fc\u3059\u308b\u30b5\u30f3\u30d7\u30eb\u30bd\u30fc\u30b9\u3092\u7d39\u4ecb\u3057 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","footnotes":""},"categories":[19],"tags":[],"class_list":["post-978","post","type-post","status-publish","format-standard","hentry","category-java"],"_links":{"self":[{"href":"https:\/\/chat-messenger.com\/en\/wp-json\/wp\/v2\/posts\/978","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chat-messenger.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chat-messenger.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chat-messenger.com\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/chat-messenger.com\/en\/wp-json\/wp\/v2\/comments?post=978"}],"version-history":[{"count":4,"href":"https:\/\/chat-messenger.com\/en\/wp-json\/wp\/v2\/posts\/978\/revisions"}],"predecessor-version":[{"id":1871,"href":"https:\/\/chat-messenger.com\/en\/wp-json\/wp\/v2\/posts\/978\/revisions\/1871"}],"wp:attachment":[{"href":"https:\/\/chat-messenger.com\/en\/wp-json\/wp\/v2\/media?parent=978"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chat-messenger.com\/en\/wp-json\/wp\/v2\/categories?post=978"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chat-messenger.com\/en\/wp-json\/wp\/v2\/tags?post=978"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}