title: How to make checkbox or combobox readonly in JavaFX
body: <p>How to make checkbox/combobox readonly in javaFX but not disabled.</p>
  
  <p>I tried consuming <code>onAction</code> event but it didn't work.</p>
  
  <pre><code>checkBox.setOnAction(new EventHandler&lt;ActionEvent&gt;() {
      @Override
      public void handle(ActionEvent event) {
          event.consume();
      }
  });
  </code></pre>
  
  <p>Consuming all events like in code below works but I don't think it's a good solution:</p>
  
  <pre><code>checkBox.addEventFilter(KeyEvent.ANY, new EventHandler&lt;KeyEvent&gt;() {
      @Override
      public void handle(KeyEvent event) {
          event.consume();
      }
  });
  checkBox.addEventFilter(MouseEvent.ANY, new EventHandler&lt;MouseEvent&gt;() {
      @Override
      public void handle(MouseEventevent) {
          event.consume();
      }
  });
  </code></pre>