title: Consume JavaFX KeyTyped event from TextField
body: <p>I'm trying to validate a TextField, where I only want to allow numbers on the TextField. My code looks like this:</p>
  
  <pre><code>public void handle(KeyEvent evt) {
      String character = evt.getCharacter();
      if(!character.equals("1")) {
          JOptionPane.showMessageDialog(null,evt.getCharacter());
          evt.consume();                
      }                                         
  }
  </code></pre>
  
  <p>This doesn't consume the event :( Is this a bug? Is there another way to do this?</p>