title: Java NetBeans GUI Key Event sending
body: <p>I'm making a simple calculator, so far I did a text field where I can type numbers and it listens if key was typed from keyboard.</p>
  
  <pre><code>private void resultKeyTyped(java.awt.event.KeyEvent evt) {  }
  </code></pre>
  
  <p>What I want is to click on let's say '1' with mouse and send a key event to this method, so it would be like I clicked it on keyboard. Tried doing keypress with robot but it says 'void type is no good here' or something like that. I wanted to just run that resultKeyTyped method from withing mouse click listener, like this:</p>
  
  <pre><code>private void jButton1MouseClicked(java.awt.event.MouseEvent evt) 
  {
      resultKeyTyped(KeyEvent.VK_1);
  } 
  </code></pre>