JAVAFX How to make a button stacked behind a Label clickable
<p>How to make a button stacked behind a Label clickable?</p>

<p><strong>Button</strong></p>

<pre><code>Button btn = new Button();
//TODO: button's main function, like onPressed, onReleased etc. here...
</code></pre>

<p><strong>Custom label</strong></p>

<pre><code>CustomLabel sp = new CustomLabel("Some texts here"));
//TODO: custom label's main function, like a translucent background etc here...
//main purpose of this is to overlay the button
</code></pre>

<p><strong>Main Pane</strong></p>

<pre><code>StackPane mainPane = new StackPane();
mainPane.getChildren.addAll(btn, sp);
</code></pre>

<p>With this, the area which the custom label overlays becomes unclickable.</p>

<p>Is there anyway to make the button still clickable even though overlay-ed, for example?
Or is there another way to do it? Something like setting label to not visible on click?</p>

<hr>

<p><strong>EDIT :</strong> To answer <a href="https://stackoverflow.com/users/3625036/itamar-green">Itamar Green</a> 's question..</p>

<p>By using the example as shown in this link: <a href="https://stackoverflow.com/questions/24607969/mouse-events-get-ignored-on-the-underlying-layer">Mouse Events get Ignored on the Underlying Layer</a> , it still does not seems to work. The button stacked under the layer is still not clickable.</p>

<pre><code>sp.setPickOnBounds(false);
</code></pre>