{"id":23,"date":"2008-05-30T10:59:07","date_gmt":"2008-05-30T17:59:07","guid":{"rendered":"http:\/\/shivdev.com\/blog\/2008\/05\/30\/copy-to-clipboard-doesnt-work-in-java\/"},"modified":"2008-05-30T11:07:41","modified_gmt":"2008-05-30T18:07:41","slug":"copy-to-clipboard-doesnt-work-in-java","status":"publish","type":"post","link":"http:\/\/shivdev.com\/blog\/2008\/05\/30\/copy-to-clipboard-doesnt-work-in-java\/","title":{"rendered":"Copy To Clipboard Doesn&#8217;t work in Java"},"content":{"rendered":"<p>We recently migrated from Java 4 to Java 6 and found out that Copy To Clipboard from JTable, JTextBox etc. just didn&#8217;t work.<\/p>\n<blockquote><p>             String selection = &#8220;Clip This&#8221;;<br \/>\nStringSelection data = new StringSelection(selection);<br \/>\nToolkit.getDefaultToolkit().getSystemClipboard().setContents(data, data);<\/p><\/blockquote>\n<p>Then I happened to notice that there was an exception on startup and it couldn&#8217;t find flavormap.properties.<\/p>\n<blockquote><p>FileNotFoundException:C:\\Program%20Files\\Java\\jre1.6.0_06\\lib\\flavormap.properties<\/p><\/blockquote>\n<p>It occurred to me at that point that the there was a SPACE in the location &#8220;Program Files&#8221; and God Knows why thats not handled correctly. So I simply uninstalled Java 6 from its Default Location and reinstalled it in C:\\jdk1.6.0_6 and that did it for me.<br \/>\n<center><br \/>\n<a href=\"http:\/\/shivdev.com\/blog\/wp-content\/uploads\/2008\/05\/java6installlocation.png\" title=\"Change Default Install Location\"><img decoding=\"async\" src=\"http:\/\/shivdev.com\/blog\/wp-content\/uploads\/2008\/05\/java6installlocation.png\" alt=\"Change Default Install Location\" \/><\/a><br \/>\n<\/center>I did a lot of searching for solutions, but looks like nobody else ran into this problem. Hey, fixing these type of issues is what we developers get paid for, right? But Microsoft, Sun &#8211; PLEASE &#8211; Don&#8217;t point fingers at each other. Just handle these issues.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We recently migrated from Java 4 to Java 6 and found out that Copy To Clipboard from JTable, JTextBox etc. just didn&#8217;t work. String selection = &#8220;Clip This&#8221;; StringSelection data = new StringSelection(selection); Toolkit.getDefaultToolkit().getSystemClipboard().setContents(data, data); Then I happened to notice that there was an exception on startup and it couldn&#8217;t find flavormap.properties. FileNotFoundException:C:\\Program%20Files\\Java\\jre1.6.0_06\\lib\\flavormap.properties It occurred [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[11],"tags":[],"_links":{"self":[{"href":"http:\/\/shivdev.com\/blog\/wp-json\/wp\/v2\/posts\/23"}],"collection":[{"href":"http:\/\/shivdev.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/shivdev.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/shivdev.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/shivdev.com\/blog\/wp-json\/wp\/v2\/comments?post=23"}],"version-history":[{"count":0,"href":"http:\/\/shivdev.com\/blog\/wp-json\/wp\/v2\/posts\/23\/revisions"}],"wp:attachment":[{"href":"http:\/\/shivdev.com\/blog\/wp-json\/wp\/v2\/media?parent=23"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/shivdev.com\/blog\/wp-json\/wp\/v2\/categories?post=23"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/shivdev.com\/blog\/wp-json\/wp\/v2\/tags?post=23"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}