Javafx: How to get ID of clicked Text element
<p>I have an Icon (based on Text) element and I can't get its ID when the element is clicked. </p>

<p>When I print mouseEvent.getSource() it is returning below text and there is an id:</p>

<pre><code>Text[id=bathroom, text="", x=0.0, y=0.0, alignment=LEFT, origin=BASELINE, boundsType=LOGICAL, font=Font[name=FontAwesome Regular, family=FontAwesome, style=Regular, size=60.0], fontSmoothingType=GRAY, fill=0x000000ff]
</code></pre>

<p>Id can be parsed from the text. But, I'm looking for proper way. </p>