title: JavaFX: How can I add a method to a subclass of Canvas that allows buttons to be added to the cavas itself?
body: <p>I have a class called MapCanvas that extends Canvas from the JavaFX library. On this canvas, I'd like to create a method that allows a button to be placed on the canvas itself (instead of a pane on top), such that when I pan and zoom in on the canvas, the button keeps the coordinates that were specified when created (so it moves around when I drag the canvas).</p>
  
  <p>The method would look like this:</p>
  
  <pre><code>public void addButton(Button button) {
      // add the button to the canvas
  }
  </code></pre>
  
  <p>So my question is: <strong>Is it possible to add a method like this, and if so, how?</strong></p>