title: Ctrl+C on Java robot is not working
body: <p>I am trying to write a code using Java robot that will copy text using <kbd>ctrl</kbd>+<kbd>c</kbd>, and then I read it from the clipboard. The code I used is this:</p>
  
  <pre><code>Robot robot = new Robot();
  robot.delay(1000);
  robot.keyPress(KeyEvent.VK_CONTROL);
  robot.keyPress(VK_C);
  robot.keyRelease(VK_C);
  robot.keyRelease(KeyEvent.VK_CONTROL);
  String str=(String)Toolkit.getDefaultToolkit().getSystemClipboard().getData(DataFlavor.stringFlavor);
  </code></pre>
  
  <p>But <code>str</code> does not contain the value that should have been copied.</p>